xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strchr(char const *, char);
char *gs_accept(char *str, const char *accept) {
  while (*str) {
    if (strchr(accept, *str))
      return str;
    str++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<gs_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <gs_accept+0x55>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1154 <gs_accept+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <gs_accept+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <gs_accept+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_accept>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <gs_accept+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <gs_accept+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <gs_accept+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @gs_accept(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_subvars_endsubv();
void fgmvwrite_subvars_endsubv_() { gmvwrite_subvars_endsubv(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_subvars_endsubv_() {
%1 = tail call i32 (...) @gmvwrite_subvars_endsubv()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g5_set_eps_to_all(double);
void(g5_set_eps_to_all_)(double *eps) { g5_set_eps_to_all(*eps); }


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

x86 assembly (clang, -O2):
<g5_set_eps_to_all_>:
movsd  (%rdi),%xmm0
jmp    1030 <g5_set_eps_to_all@plt>

LLVM IR (-O0):
define void @g5_set_eps_to_all_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call i32 @g5_set_eps_to_all(double %4)
ret void
}

LLVM IR (-O2):
define void @g5_set_eps_to_all_(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @g5_set_eps_to_all(double %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void err(char *msg) {
  printf("ERROR: %s\n", msg);
  exit(0);
}


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

x86 assembly (clang, -O2):
<err>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void uart_init(void) {
  int a;
  if (1 == 1) {
    a = 1;
    outb(a, 0x3f8);
  } else {
    a = 2;
    outb(a, 0x3f8);
  }
  outb(a, 0x3f8);
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
push   %rax
mov    $0x1,%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
mov    $0x1,%edi
mov    $0x3f8,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @uart_init() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @outb(i32 %2, i32 1016)
%4 = load i32, i32* %1
%5 = call i32 @outb(i32 %4, i32 1016)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = tail call i32 @outb(i32 1, i32 1016)
%2 = tail call i32 @outb(i32 1, i32 1016)
ret void
}
int test_imm_52uint32_mem(unsigned int *val) {
  return ((*val) & (0x52 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_52uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 82
%6 = icmp ne i32 %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_52uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 82
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ memcmp(unsigned char const *, char const *, int);
int patterntest(const unsigned char *buf, const char *pattern, int offset,
                int bytes, int maxlen) {
  if ((offset + bytes) <= maxlen)
    return (memcmp(buf + offset, pattern, bytes) == 0) ? 1 : 0;
  return 0;
}


x86 assembly (clang, -O0):
<patterntest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jg     1169 <patterntest+0x59>
mov    -0x10(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <memcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <patterntest+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<patterntest>:
lea    (%rcx,%rdx,1),%r9d
xor    %eax,%eax
cmp    %r8d,%r9d
jg     1138 <patterntest+0x28>
push   %rax
movslq %edx,%rax
add    %rax,%rdi
mov    %ecx,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @patterntest(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %3, %2
%7 = icmp sgt i32 %6, %4
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i64 @memcmp(i8* %10, i8* %1, i32 %3)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %8
%15 = phi i32 [ %13, %8 ], [ 0, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int normal_fun() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/posix/raise.c",
         35);
  raise(SIGINT);
  return 0;
}


x86 assembly (clang, -O0):
<normal_fun>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x23,%edx
call   1040 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_fun>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x23,%edx
call   1040 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@SIGINT = global i32 0
define i32 @normal_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 35)
%2 = load i32, i32* @SIGINT
%3 = call i32 @raise(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/posix/raise.c\00"
@SIGINT = global i32 0
define i32 @normal_fun() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 35)
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @raise(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_read_local_supported_codecs(const void *test_data) {
  test_command(0x100b);
}


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

x86 assembly (clang, -O2):
<test_read_local_supported_codecs>:
mov    $0x100b,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_read_local_supported_codecs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 4107)
ret void
}

LLVM IR (-O2):
define void @test_read_local_supported_codecs(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 4107)
ret void
}
void startRaspiStill(int width, int height, int frames, int objIndex) {}


x86 assembly (clang, -O0):
<startRaspiStill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @startRaspiStill(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
float absf(float const);
float flt_abs(const float x) { return absf(x); }


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

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

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

LLVM IR (-O2):
define float @flt_abs(float %0) {
%2 = tail call float @absf(float %0)
ret float %2
}
ISR1(DUMMY_VECTOR) {}


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

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

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

LLVM IR (-O2):
define i32 @ISR1(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int round(float);
float komi_round(float x) { return round(x * 0.5) * 2; }


x86 assembly (clang, -O0):
<komi_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <round@plt>
shl    $0x1,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<komi_round>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <round@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @komi_round(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 5.000000e-01
%6 = fptrunc double %5 to float
%7 = call i32 @round(float %6)
%8 = mul nsw i32 %7, 2
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @komi_round(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = tail call i32 @round(float %2)
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to float
ret float %5
}
void extract_number_and_incr(destination, source) int *destination;
unsigned char **source;
{
  *destination = extract_number(*source);
  *source += 2;
}


x86 assembly (clang, -O0):
<extract_number_and_incr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <extract_number@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_number_and_incr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
xor    %eax,%eax
call   1030 <extract_number@plt>
mov    %eax,(%r14)
addq   $0x2,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @extract_number_and_incr(i32* nocapture writeonly %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @extract_number to i32 (i8*, ...)*)(i8* %3)
store i32 %4, i32* %0
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %6, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_draw_rect() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_draw_rect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_draw_rect>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_draw_rect() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_draw_rect() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Keypad_setCode(int, char *);
int atoi(char *);
char *strtok(int /*<<< orphan*/ *, char *);
void setPasscode(char *code) {
  code = strtok(NULL, " ");
  int length = atoi(code);
  code = strtok(NULL, " ");
  Keypad_setCode(length, code);
}


x86 assembly (clang, -O0):
<setPasscode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe99(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <Keypad_setCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPasscode>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <strtok@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <strtok@plt>
mov    %ebp,%edi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Keypad_setCode@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @setPasscode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %3
%7 = call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = call i32 @Keypad_setCode(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @setPasscode(i8* nocapture readnone %0) {
%2 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @atoi(i8* %2)
%4 = tail call i8* @strtok(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @Keypad_setCode(i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void msWait(int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<msWait>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @msWait(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
char *get_arg_from_pointer_malloc_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ get_pointer_to_arg_ptr(char *, int);
char *get_arg_malloc_ptr(char *input_ptr, int arg) {
  return get_arg_from_pointer_malloc_ptr(
      get_pointer_to_arg_ptr(input_ptr, arg));
}


x86 assembly (clang, -O0):
<get_arg_malloc_ptr>:
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 <get_pointer_to_arg_ptr@plt>
mov    %eax,%edi
call   1040 <get_arg_from_pointer_malloc_ptr@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @get_arg_malloc_ptr(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 @get_pointer_to_arg_ptr(i8* %5, i32 %6)
%8 = call i8* @get_arg_from_pointer_malloc_ptr(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_arg_malloc_ptr(i8* %0, i32 %1) {
%3 = tail call i32 @get_pointer_to_arg_ptr(i8* %0, i32 %1)
%4 = tail call i8* @get_arg_from_pointer_malloc_ptr(i32 %3)
ret i8* %4
}
/* Variables and functions */
int strcmp(char *, char *);
int func_qsort_strcmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<func_qsort_strcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @func_qsort_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @func_qsort_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void simd_destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @simd_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ free_lex_buffer();
void finish_parse(int **err_counts) {
  free_lex_buffer();
  free(*err_counts);
  *err_counts = NULL;
}


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

x86 assembly (clang, -O2):
<finish_parse>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <free_lex_buffer@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @finish_parse(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32 (...) @free_lex_buffer()
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = call i32 @free(i32* %5)
%7 = load i32**, i32*** %2
store i32* null, i32** %7
ret void
}

LLVM IR (-O2):
define void @finish_parse(i32** nocapture %0) {
%2 = tail call i32 (...) @free_lex_buffer()
%3 = load i32*, i32** %0
%4 = tail call i32 @free(i32* %3)
store i32* null, i32** %0
ret void
}
void gdk_gravity_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gravity_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int /*<<< orphan*/);
int /*<<< orphan*/ output_w32(int);
void emit_writeword_imm(int imm, int addr) {
  assem_debug("movl $%x,%x", imm, addr);
  output_byte(0xC7);
  output_modrm(0, 5, 0);
  output_w32(addr);
  output_w32(imm);
}


x86 assembly (clang, -O0):
<emit_writeword_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xc7,%edi
call   1050 <output_byte@plt>
xor    %edx,%edx
mov    $0x5,%esi
mov    %edx,%edi
call   1060 <output_modrm@plt>
mov    -0x8(%rbp),%edi
call   1040 <output_w32@plt>
mov    -0x4(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_writeword_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
mov    $0xc7,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1060 <output_modrm@plt>
mov    %ebx,%edi
call   1040 <output_w32@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"movl $%x,%x\00"
define void @emit_writeword_imm(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 @assem_debug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @output_byte(i32 199)
%9 = call i32 @output_modrm(i32 0, i32 5, i32 0)
%10 = load i32, i32* %4
%11 = call i32 @output_w32(i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @output_w32(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"movl $%x,%x\00"
define void @emit_writeword_imm(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @output_byte(i32 199)
%5 = tail call i32 @output_modrm(i32 0, i32 5, i32 0)
%6 = tail call i32 @output_w32(i32 %1)
%7 = tail call i32 @output_w32(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_int(int /*<<< orphan*/, int /*<<< orphan*/);
uint32_t hash_pointer(const void *p, uint32_t basis) {
  return hash_int((uint32_t)(uintptr_t)p, basis);
}


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

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

LLVM IR (-O0):
define i32 @hash_pointer(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 = ptrtoint i8* %5 to i64
%7 = trunc i64 %6 to i32
%8 = load i32, i32* %4
%9 = call i32 @hash_int(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_pointer(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @hash_int(i32 %4, i32 %1)
ret i32 %5
}
unsigned popcount64(unsigned long long x) { return __builtin_popcountll(x); }


x86 assembly (clang, -O0):
<popcount64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount64>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @popcount64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @popcount64(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int errno;
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *const);
void mutex_destroy(pthread_mutex_t *const mutex) {
  int _errno = errno;
  (void)pthread_mutex_destroy(mutex);
  errno = _errno;
}


x86 assembly (clang, -O0):
<mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    -0xc(%rbp),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_destroy>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <pthread_mutex_destroy@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @mutex_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32*, i32** %2
%6 = call i32 @pthread_mutex_destroy(i32* %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @mutex_destroy(i32* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @pthread_mutex_destroy(i32* %0)
store i32 %2, i32* @errno
ret void
}
double interpolate_linear(double from, double to, double fraction) {
  return from + (fraction * (to - from));
}


x86 assembly (clang, -O0):
<interpolate_linear>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_linear>:
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @interpolate_linear(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = load double, double* %5
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @interpolate_linear(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %0)
ret double %5
}
void foo089() {}


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

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

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

LLVM IR (-O2):
define void @foo089() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ fs_exsists(char const *);
int /*<<< orphan*/ stat(char const *, struct stat *);
mode_t fs_mode(const char *restrict filepath) {
  struct stat file_status = {0};
  if (!fs_exsists(filepath))
    return 0;
  stat(filepath, &file_status);
  return file_status.st_mode;
}


x86 assembly (clang, -O0):
<fs_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fs_exsists@plt>
cmp    $0x0,%eax
jne    116a <fs_mode+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    117d <fs_mode+0x4d>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mode>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
call   1040 <fs_exsists@plt>
test   %eax,%eax
je     114d <fs_mode+0x2d>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <stat@plt>
mov    0x8(%rsp),%eax
jmp    114f <fs_mode+0x2f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32 }
define i32 @fs_mode(i8* noalias %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = bitcast %struct.stat* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @fs_exsists(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %15
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @stat(i8* %11, %struct.stat* %4)
%13 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%14 = load i32, i32* %13
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i32 @fs_mode(i8* noalias %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = tail call i32 @fs_exsists(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = bitcast i64* %2 to %struct.stat*
%8 = call i32 @stat(i8* %0, %struct.stat* %7)
%9 = bitcast i64* %2 to i32*
%10 = load i32, i32* %9
br label %11
11: ; preds = %1, %6
%12 = phi i32 [ %10, %6 ], [ 0, %1 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void ecrire_int_ascii(FILE *fichier, int entier) {
  fprintf(fichier, "%d ", entier);
}


x86 assembly (clang, -O0):
<ecrire_int_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrire_int_ascii>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @ecrire_int_ascii(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 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @ecrire_int_ascii(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int add(int, int);
int c1_redirect(int x) {
  int const result = add(x, 1);
  return result;
}


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

x86 assembly (clang, -O2):
<c1_redirect>:
mov    $0x1,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @c1_redirect(i32 %0) {
%2 = tail call i32 @add(i32 %0, i32 1)
ret i32 %2
}
int octave_wcontinue_wrapper(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @octave_wcontinue_wrapper() {
ret i32 0
}
int ZeroRealDenseVector(q_p, nzq_p)
double *q_p;
int *nzq_p;
{
  static double *q_ps;
  q_ps = q_p + *nzq_p;
  for (; q_p < q_ps; q_p++)
    *q_p = 0.0;
  return 0;
}


x86 assembly (clang, -O0):
<ZeroRealDenseVector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,0x2f03(%rip)
mov    -0x8(%rbp),%rax
cmp    0x2ef8(%rip),%rax
jae    1152 <ZeroRealDenseVector+0x52>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1125 <ZeroRealDenseVector+0x25>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroRealDenseVector>:
push   %rax
movslq (%rsi),%rax
test   %rax,%rax
jle    1141 <ZeroRealDenseVector+0x31>
lea    (%rdi,%rax,8),%rax
lea    0x8(%rdi),%rcx
cmp    %rcx,%rax
cmova  %rax,%rcx
mov    %rdi,%rax
not    %rax
lea    (%rcx,%rax,1),%rdx
add    $0x8,%rdx
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ZeroRealDenseVector.q_ps = internal global double* null
define i32 @ZeroRealDenseVector(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
store double* %0, double** %3
store i32* %1, i32** %4
%5 = load double*, double** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds double, double* %5, i64 %8
store double* %9, double** @ZeroRealDenseVector.q_ps
br label %10
10: ; preds = %16, %2
%11 = load double*, double** %3
%12 = load double*, double** @ZeroRealDenseVector.q_ps
%13 = icmp ult double* %11, %12
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load double*, double** %3
store double 0.000000e+00, double* %15
br label %16
16: ; preds = %14
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i32 1
store double* %18, double** %3
br label %10
19: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @ZeroRealDenseVector(double* %0, i32* nocapture %1) {
%3 = ptrtoint double* %0 to i64
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = sext i32 %4 to i64
%8 = bitcast double* %0 to i8*
%9 = shl nsw i64 %7, 3
%10 = add i64 %9, %3
%11 = add i64 %3, 8
%12 = call i64 @llvm.umax.i64(i64 %10, i64 %11)
%13 = xor i64 %3, -1
%14 = add i64 %12, %13
%15 = add i64 %14, 8
%16 = and i64 %15, -8
br label %17
17: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello world !"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello world !\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello world !\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int int_length(int i) {
  int aux = 0;
  do {
    i = i / 10;
    aux++;
  } while (i != 0);
  return aux;
}


x86 assembly (clang, -O0):
<int_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <int_length+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_length>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <int_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @int_length(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = sdiv i32 %3, 10
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %6
}
long long int binary(long long int b) {
  long long int i;
  i = b % 2;
  return i;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
mov    %rdi,%rax
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
and    $0xfffffffffffffffe,%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @binary(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = srem i64 %4, 2
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @binary(i64 %0) {
%2 = srem i64 %0, 2
ret i64 %2
}
/* Variables and functions */
int f97(int *);
int f98(int *p) { return f97(p); }


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

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

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

LLVM IR (-O2):
define i32 @f98(i32* %0) {
%2 = tail call i32 @f97(i32* %0)
ret i32 %2
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **arv) {
  for (;;) {
    printf("%d\n", getpid());
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %6, %2
%7 = call i32 (...) @getpid()
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 1)
br label %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 1)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int array[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", array[i]);
  printf("n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0x6e,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"n\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 110)
ret void
}
int func(int x, int y) { return x + y; }


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

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

LLVM IR (-O0):
define i32 @func(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}