xunge/DecIR huggingface dataset:
void subvv(float *result, const float *s1) {
  result[0] -= s1[0];
  result[1] -= s1[1];
  result[2] -= s1[2];
}


x86 assembly (clang, -O0):
<subvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subvv>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @subvv(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fsub float %10, %7
store float %11, float* %9
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fsub float %17, %14
store float %18, float* %16
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = fsub float %24, %21
store float %25, float* %23
ret void
}

LLVM IR (-O2):
define void @subvv(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fsub float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fsub float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fsub float %14, %12
store float %15, float* %13
ret void
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_source_listener {
  int dummy;
};
struct wl_data_source {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_data_source_add_listener(struct wl_data_source *wl_data_source,
                                const struct wl_data_source_listener *listener,
                                void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_data_source,
                               (void (**)(void))listener, data);
}


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

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

LLVM IR (-O0):
%struct.wl_data_source = type { i32 }
%struct.wl_data_source_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_source_add_listener(%struct.wl_data_source* %0, %struct.wl_data_source_listener* %1, i8* %2) {
%4 = alloca %struct.wl_data_source*
%5 = alloca %struct.wl_data_source_listener*
%6 = alloca i8*
store %struct.wl_data_source* %0, %struct.wl_data_source** %4
store %struct.wl_data_source_listener* %1, %struct.wl_data_source_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_data_source*, %struct.wl_data_source** %4
%8 = bitcast %struct.wl_data_source* %7 to %struct.wl_proxy*
%9 = load %struct.wl_data_source_listener*, %struct.wl_data_source_listener** %5
%10 = bitcast %struct.wl_data_source_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_data_source = type { i32 }
%struct.wl_data_source_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_source_add_listener(%struct.wl_data_source* %0, %struct.wl_data_source_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_data_source* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_data_source_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int exampleProgram();
int main() {
  assert(sizeof(size_t) == sizeof(size_t));
  return exampleProgram();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <exampleProgram@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <exampleProgram@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @assert(i32 1)
%3 = call i32 (...) @exampleProgram()
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 (...) @exampleProgram()
ret i32 %2
}
/* Type definitions */
struct i2c {
  int dummy;
};

/* Variables and functions */
long getBCD(int /*<<< orphan*/);
int /*<<< orphan*/ getWord(struct i2c *, int, int);
long getBatteryVoltage(struct i2c *i2c) {
  return getBCD(getWord(i2c, 0x69, 0x01));
}


x86 assembly (clang, -O0):
<getBatteryVoltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x69,%esi
mov    $0x1,%edx
call   1040 <getWord@plt>
mov    %eax,%edi
call   1030 <getBCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBatteryVoltage>:
push   %rax
mov    $0x69,%esi
mov    $0x1,%edx
call   1040 <getWord@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <getBCD@plt>

LLVM IR (-O0):
%struct.i2c = type { i32 }
define i64 @getBatteryVoltage(%struct.i2c* %0) {
%2 = alloca %struct.i2c*
store %struct.i2c* %0, %struct.i2c** %2
%3 = load %struct.i2c*, %struct.i2c** %2
%4 = call i32 @getWord(%struct.i2c* %3, i32 105, i32 1)
%5 = call i64 @getBCD(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
%struct.i2c = type { i32 }
define i64 @getBatteryVoltage(%struct.i2c* %0) {
%2 = tail call i32 @getWord(%struct.i2c* %0, i32 105, i32 1)
%3 = tail call i64 @getBCD(i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *alloc_mem(size_t size) {
  void *p;
  p = (void *)malloc(size);
  if (!p) {
    perror("Memory allocation error");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<alloc_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <alloc_mem+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_mem>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <alloc_mem+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Memory allocation error\00"
define i8* @alloc_mem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [24 x i8] c"Memory allocation error\00"
define i8* @alloc_mem(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int bitmap64_test(int64_t *bitmap, int n) {
  return ((*bitmap & ((int64_t)1 << n)) > (int64_t)0);
}


x86 assembly (clang, -O0):
<bitmap64_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap64_test>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edx,(%rdi)
setg   %al
ret

LLVM IR (-O0):
define i32 @bitmap64_test(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* %5
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bitmap64_test(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = shl nuw i32 1, %1
%5 = and i32 %3, %4
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void hallo() {
  printf("ICH BIN HALLO -- UND DAS IST EIN FEHLER!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<hallo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [42 x i8] c"ICH BIN HALLO -- UND DAS IST EIN FEHLER!\0A\00"
define void @hallo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [41 x i8] c"ICH BIN HALLO -- UND DAS IST EIN FEHLER!\00"
define void @hallo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ Pidentifier();
scalar_t__ Pname();
scalar_t__ Prename();
PnameDef() {
  int b = -1;
  ;
  b = Pidentifier() || Pname() || Prename();
  return (b);
}


x86 assembly (clang, -O0):
<PnameDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Pidentifier@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1182 <PnameDef+0x52>
mov    $0x0,%al
call   1030 <Pname@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1182 <PnameDef+0x52>
mov    $0x0,%al
call   1040 <Prename@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PnameDef>:
push   %rbx
xor    %eax,%eax
call   1050 <Pidentifier@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115d <PnameDef+0x2d>
xor    %eax,%eax
call   1030 <Pname@plt>
test   %rax,%rax
jne    115d <PnameDef+0x2d>
xor    %eax,%eax
call   1040 <Prename@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @PnameDef() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i64 (...) @Pidentifier()
%3 = icmp ne i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = call i64 (...) @Pname()
%6 = icmp ne i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = call i64 (...) @Prename()
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %4, %0
%11 = phi i1 [ true, %4 ], [ true, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
store i32 %12, i32* %1
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @PnameDef() {
%1 = tail call i64 (...) @Pidentifier()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 (...) @Pname()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @Prename()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %3 ], [ 1, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M556_f(char *s) {
  debug("M556_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M556_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M556_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M556_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M556_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M556_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M556_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void g5_set_range(double xmin, double xmax, double mmin) { return; }


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

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

LLVM IR (-O0):
define void @g5_set_range(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
ret void
}

LLVM IR (-O2):
define void @g5_set_range(double %0, double %1, double %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int is_uint(const char *str) {
  if (!*str) {
    return 0;
  }
  for (; *str; str++) {
    if (!isdigit(*str)) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1135 <is_uint+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1185 <is_uint+0x75>
jmp    113a <is_uint+0x2a>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117e <is_uint+0x6e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1168 <is_uint+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1185 <is_uint+0x75>
jmp    116d <is_uint+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <is_uint+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uint>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
xor    %ebp,%ebp
test   %al,%al
je     114c <is_uint+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     114c <is_uint+0x3c>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_uint+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_uint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8* [ %10, %9 ], [ %0, %1 ]
%6 = phi i8 [ %11, %9 ], [ %2, %1 ]
%7 = tail call i32 @isdigit(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %9 ]
ret i32 %14
}
/* Variables and functions */
int CDInit(int, int, int, int);
int CDRead(int);
int main() {
  int keyControll = 0, keyPressed;
  keyControll = CDInit(4, 4, 2, 3);
  keyPressed = CDRead(keyControll);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    %esi,%edi
call   1040 <CDInit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <CDRead@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1040 <CDInit@plt>
mov    %eax,%edi
call   1030 <CDRead@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @CDInit(i32 4, i32 4, i32 2, i32 3)
%2 = tail call i32 @CDRead(i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t __MAX(int64_t a, int64_t b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<__MAX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <__MAX+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <__MAX+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__MAX>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @__MAX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @__MAX(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: gps-sdr-sim [options]\n"
         "Options:\n"
         "  -e <gps_nav>     RINEX navigation file for GPS ephemerides "
         "(required)\n"
         "  -u <user_motion> User motion file (dynamic mode)\n"
         "  -g <nmea_gga>    NMEA GGA stream (dynamic mode)\n"
         "  -l <location>    Lat,Lon,Hgt (static mode) e.g. "
         "30.286502,120.032669,100\n"
         "  -o <output>      I/Q sampling data file (default: gpssim.bin)\n"
         "  -s <frequency>   Sampling frequency [Hz] (default: 2600000)\n"
         "  -b <iq_bits>     I/Q data format [8/16] (default: 8)\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [468 x i8] c"Usage: gps-sdr-sim [options]\0AOptions:\0A -e <gps_nav> RINEX navigation file for GPS ephemerides (required)\0A -u <user_motion> User motion file (dynamic mode)\0A -g <nmea_gga> NMEA GGA stream (dynamic mode)\0A -l <location> Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100\0A -o <output> I/Q sampling data file (default: gpssim.bin)\0A -s <frequency> Sampling frequency [Hz] (default: 2600000)\0A -b <iq_bits> I/Q data format [8/16] (default: 8)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([468 x i8], [468 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [467 x i8] c"Usage: gps-sdr-sim [options]\0AOptions:\0A -e <gps_nav> RINEX navigation file for GPS ephemerides (required)\0A -u <user_motion> User motion file (dynamic mode)\0A -g <nmea_gga> NMEA GGA stream (dynamic mode)\0A -l <location> Lat,Lon,Hgt (static mode) e.g. 30.286502,120.032669,100\0A -o <output> I/Q sampling data file (default: gpssim.bin)\0A -s <frequency> Sampling frequency [Hz] (default: 2600000)\0A -b <iq_bits> I/Q data format [8/16] (default: 8)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([467 x i8], [467 x i8]* @str, i64 0, i64 0))
ret void
}
void gtk_menu_set_monitor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_set_monitor() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long myclock() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<myclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myclock>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @myclock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
char *dln_find_file(fname, path) const char *fname;
const char *path;
{
  if (!path)
    path = ".";
  return dln_find_1(fname, path, 0);
}


x86 assembly (clang, -O0):
<dln_find_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <dln_find_file+0x26>
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <dln_find_1@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dln_find_file>:
push   %rax
test   %rsi,%rsi
lea    0xee5(%rip),%rax
cmove  %rax,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <dln_find_1@plt>
cltq
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @dln_find_file(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %1
%5 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @dln_find_1 to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %4, i32 0)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ASN1_item_i2d_fp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey_it;
int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) {
  return ASN1_item_i2d_fp(&RSAPublicKey_it, fp, rsa);
}


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

x86 assembly (clang, -O2):
<i2d_RSAPublicKey_fp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_i2d_fp@plt>

LLVM IR (-O0):
@RSAPublicKey_it = global i32 0
define i32 @i2d_RSAPublicKey_fp(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 @ASN1_item_i2d_fp(i32* @RSAPublicKey_it, i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@RSAPublicKey_it = global i32 0
define i32 @i2d_RSAPublicKey_fp(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_fp(i32* @RSAPublicKey_it, i32* %0, i32* %1)
ret i32 %3
}
void _instruction_storage() { printf("Exception: %s\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<_instruction_storage>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._instruction_storage = [21 x i8] c"_instruction_storage\00"
define void @_instruction_storage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__._instruction_storage, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._instruction_storage = [21 x i8] c"_instruction_storage\00"
define void @_instruction_storage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__._instruction_storage, i64 0, i64 0))
ret void
}
void XSyncChangeAlarm() {}


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

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

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

LLVM IR (-O2):
define void @XSyncChangeAlarm() {
ret void
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_zero(int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *psvec2i_zero(struct vec2i *result) {
  vec2i_zero((int32_t *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2i_zero>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_zero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_zero(%struct.vec2i* %0) {
%2 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %2
%3 = load %struct.vec2i*, %struct.vec2i** %2
%4 = bitcast %struct.vec2i* %3 to i32*
%5 = call i32 @vec2i_zero(i32* %4)
%6 = load %struct.vec2i*, %struct.vec2i** %2
ret %struct.vec2i* %6
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_zero(%struct.vec2i* returned %0) {
%2 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%3 = tail call i32 @vec2i_zero(i32* %2)
ret %struct.vec2i* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello_world(void) {
  printf("Success!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Success!\00"
define i32 @hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_isr_handler();
__attribute__((weak)) void timer0a_isr_handler(void) { default_isr_handler(); }


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

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

LLVM IR (-O0):
define weak void @timer0a_isr_handler() {
%1 = call i32 (...) @default_isr_handler()
ret void
}

LLVM IR (-O2):
define weak void @timer0a_isr_handler() {
%1 = tail call i32 (...) @default_isr_handler()
ret void
}
void aff2_print_info(int verbose) {}


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

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

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

LLVM IR (-O2):
define void @aff2_print_info(i32 %0) {
ret void
}
signed int calc_slider_pos(float from, float to, float value, signed int size) {
  if (from == to)
    return 0;
  return ((value - from) / (to - from)) * size;
}


x86 assembly (clang, -O0):
<calc_slider_pos>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1137 <calc_slider_pos+0x37>
jp     1137 <calc_slider_pos+0x37>
movl   $0x0,-0x4(%rbp)
jmp    115f <calc_slider_pos+0x5f>
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_slider_pos>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
jne    110a <calc_slider_pos+0xa>
jp     110a <calc_slider_pos+0xa>
ret
subss  %xmm0,%xmm2
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %edi,%xmm0
divss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @calc_slider_pos(float %0, float %1, float %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store i32 %3, i32* %9
%10 = load float, float* %6
%11 = load float, float* %7
%12 = fcmp oeq float %10, %11
br i1 %12, label %13, label %14
13: ; preds = %4
store i32 0, i32* %5
br label %26
14: ; preds = %4
%15 = load float, float* %8
%16 = load float, float* %6
%17 = fsub float %15, %16
%18 = load float, float* %7
%19 = load float, float* %6
%20 = fsub float %18, %19
%21 = fdiv float %17, %20
%22 = load i32, i32* %9
%23 = sitofp i32 %22 to float
%24 = fmul float %21, %23
%25 = fptosi float %24 to i32
store i32 %25, i32* %5
br label %26
26: ; preds = %14, %13
%27 = load i32, i32* %5
ret i32 %27
}

LLVM IR (-O2):
define i32 @calc_slider_pos(float %0, float %1, float %2, i32 %3) {
%5 = fcmp oeq float %0, %1
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = fsub float %2, %0
%8 = fsub float %1, %0
%9 = fdiv float %7, %8
%10 = sitofp i32 %3 to float
%11 = fmul float %9, %10
%12 = fptosi float %11 to i32
br label %13
13: ; preds = %4, %6
%14 = phi i32 [ %12, %6 ], [ 0, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *getRandomVector(int);
int main() {
  int *num = getRandomVector(10);
  free(num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <getRandomVector@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <getRandomVector@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @getRandomVector(i32 10)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @free(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @getRandomVector(i32 10)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_cpu_freq_hz(void) { return 50 * 1000 * 1000; }


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

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

LLVM IR (-O0):
define i32 @get_cpu_freq_hz() {
ret i32 50000000
}

LLVM IR (-O2):
define i32 @get_cpu_freq_hz() {
ret i32 50000000
}
int meta_levels(char *sym_name) {
  char current_char = *sym_name;
  int count = 0;
  while (current_char == ':') {
    count++;
    current_char = sym_name[count];
  }
  return count;
}


x86 assembly (clang, -O0):
<meta_levels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x3a,%eax
jne    1141 <meta_levels+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x9(%rbp)
jmp    1118 <meta_levels+0x18>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<meta_levels>:
xor    %eax,%eax
cmpb   $0x3a,(%rdi)
jne    111b <meta_levels+0x1b>
xor    %eax,%eax
nopl   0x0(%rax)
cmpb   $0x3a,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
je     1110 <meta_levels+0x10>
ret

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

LLVM IR (-O2):
define i32 @meta_levels(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 58
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 58
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int string_match(const char *tok, const char *string) {
  if (strcasecmp(tok, "ALL") == 0) {
    return (1);
  } else if (strcasecmp(tok, string) == 0) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<string_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1146 <string_match+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1175 <string_match+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1169 <string_match+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1175 <string_match+0x65>
jmp    116e <string_match+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_match>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1143 <string_match+0x33>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1148 <string_match+0x38>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ALL\00"
define i32 @string_match(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i64 @strcasecmp(i8* %11, i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %3
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16
store i32 0, i32* %3
br label %18
18: ; preds = %17, %15, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"ALL\00"
define i32 @string_match(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
int find_ch_index(char string[], char ch) { return (-1); }


x86 assembly (clang, -O0):
<find_ch_index>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @find_ch_index(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @find_ch_index(i8* nocapture readnone %0, i8 signext %1) {
ret i32 -1
}
int test_imm_1Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x1C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 120259084288
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ machine_push_object(struct lemon *, struct lobject *);
void lemon_machine_push_object(struct lemon *lemon, struct lobject *object) {
  machine_push_object(lemon, object);
}


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

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

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define void @lemon_machine_push_object(%struct.lemon* %0, %struct.lobject* %1) {
%3 = alloca %struct.lemon*
%4 = alloca %struct.lobject*
store %struct.lemon* %0, %struct.lemon** %3
store %struct.lobject* %1, %struct.lobject** %4
%5 = load %struct.lemon*, %struct.lemon** %3
%6 = load %struct.lobject*, %struct.lobject** %4
%7 = call i32 @machine_push_object(%struct.lemon* %5, %struct.lobject* %6)
ret void
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define void @lemon_machine_push_object(%struct.lemon* %0, %struct.lobject* %1) {
%3 = tail call i32 @machine_push_object(%struct.lemon* %0, %struct.lobject* %1)
ret void
}
int flattenarray() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @flattenarray() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("this is p2 "); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"this is p2 \00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is p2 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "01:45:19"
         " "
         "Mar 16 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}


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

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"spi-hdlc-adapter 0.07 (01:45:19 Mar 16 2022)\0A\00"
@.str.1 = [64 x i8] c"Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"spi-hdlc-adapter 0.07 (01:45:19 Mar 16 2022)\00"
@str.2 = [63 x i8] c"Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int pid_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int system(char *);
int printfds(pid_t pid) {
  char buf[256];
  snprintf(buf, sizeof(buf), "ls -l /proc/%i/fd", pid);
  return system(buf);
}


x86 assembly (clang, -O0):
<printfds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfds>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"ls -l /proc/%i/fd\00"
define i32 @printfds(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"ls -l /proc/%i/fd\00"
define i32 @printfds(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @system(i8* %3)
ret i32 %5
}