xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ msm_ois_i2c_write(unsigned short, unsigned int, int);
void RamWrite32(unsigned char RamAddrH, unsigned char RamAddrL,
                unsigned short RamDataH, unsigned short RamDataL) {
  unsigned short reg_addr;
  unsigned int reg_data;
  reg_addr = RamAddrH << 8 | RamAddrL;
  reg_data = RamDataH << 16 | RamDataL;
  msm_ois_i2c_write(reg_addr, reg_data, 4);
}


x86 assembly (clang, -O0):
<RamWrite32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x8(%rbp)
movzwl -0x4(%rbp),%eax
shl    $0x10,%eax
movzwl -0x6(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ax
mov    -0xc(%rbp),%esi
mov    $0x4,%edx
movzwl %ax,%edi
call   1030 <msm_ois_i2c_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamWrite32>:
shl    $0x8,%edi
or     %esi,%edi
shl    $0x10,%edx
lea    (%rdx,%rcx,1),%esi
mov    $0x4,%edx
jmp    1030 <msm_ois_i2c_write@plt>

LLVM IR (-O0):
define void @RamWrite32(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %9
%18 = load i16, i16* %7
%19 = zext i16 %18 to i32
%20 = shl i32 %19, 16
%21 = load i16, i16* %8
%22 = zext i16 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %10
%24 = load i16, i16* %9
%25 = load i32, i32* %10
%26 = call i32 @msm_ois_i2c_write(i16 zeroext %24, i32 %25, i32 4)
ret void
}

LLVM IR (-O2):
define void @RamWrite32(i8 zeroext %0, i8 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = zext i8 %0 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %1 to i16
%8 = or i16 %6, %7
%9 = zext i16 %2 to i32
%10 = shl nuw i32 %9, 16
%11 = zext i16 %3 to i32
%12 = or i32 %10, %11
%13 = tail call i32 @msm_ois_i2c_write(i16 zeroext %8, i32 %12, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: ./generate [OPTION]... FILE\n\n"
                  "Option:\n"
                  "  -t <string>       define type, either 'hosts' or 'paths'\n"
                  "  -n <string>       define the variable name\n"
                  "  -b <float>        set load factor of bloom filter\n"
                  "  -h <float>        set load factor of hash table\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [251 x i8] c"Usage: ./generate [OPTION]... FILE\0A\0AOption:\0A -t <string> define type, either 'hosts' or 'paths'\0A -n <string> define the variable name\0A -b <float> set load factor of bloom filter\0A -h <float> set load factor of hash table\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([251 x i8], [251 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [251 x i8] c"Usage: ./generate [OPTION]... FILE\0A\0AOption:\0A -t <string> define type, either 'hosts' or 'paths'\0A -n <string> define the variable name\0A -b <float> set load factor of bloom filter\0A -h <float> set load factor of hash table\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([251 x i8], [251 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
istroff(s) char *s;
{ return (*s == '.' && !isdigit(*(s + 1))); }


x86 assembly (clang, -O0):
<istroff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1149 <istroff+0x39>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istroff>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    1116 <istroff+0x16>
movsbl 0x1(%rdi),%ecx
add    $0xffffffc6,%ecx
xor    %eax,%eax
cmp    $0xfffffff6,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @istroff(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 46
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 @isdigit(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %7, %1
%16 = phi i1 [ false, %1 ], [ %14, %7 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @istroff(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -58
%9 = icmp ult i32 %8, -10
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ do_sendf(int, char *, char *);
void japi_set_input_handler_on_change(int sd, char *arg) {
  do_sendf(sd, "INPUTONCHANGE\n%s\n", arg);
}


x86 assembly (clang, -O0):
<japi_set_input_handler_on_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <do_sendf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"INPUTONCHANGE\0A%s\0A\00"
define void @japi_set_input_handler_on_change(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @do_sendf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"INPUTONCHANGE\0A%s\0A\00"
define void @japi_set_input_handler_on_change(i32 %0, i8* %1) {
%3 = tail call i32 @do_sendf(i32 %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int calculate_fib(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int n = 0, res = 0;
  res = scanf("%d", &n);
  printf("%d", calculate_fib(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <calculate_fib@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <calculate_fib@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @calculate_fib(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\n Testando git...");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = [18 x i8] c"\0A Testando git...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A Testando git...\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct _stor_fdelete_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ osapi_free(struct _stor_fdelete_req *);
void stor_fdelete_req_free(struct _stor_fdelete_req *ptr) { osapi_free(ptr); }


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

x86 assembly (clang, -O2):
<stor_fdelete_req_free>:
jmp    1030 <osapi_free@plt>

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

LLVM IR (-O2):
%struct._stor_fdelete_req = type { i32 }
define void @stor_fdelete_req_free(%struct._stor_fdelete_req* %0) {
%2 = tail call i32 @osapi_free(%struct._stor_fdelete_req* %0)
ret void
}
void f_b(char *a) {}


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

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

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

LLVM IR (-O2):
define void @f_b(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_endian_swap_s1();
int /*<<< orphan*/ test_s2();
int /*<<< orphan*/ test_s3();
int main(void) {
  test_endian_swap_s1();
  test_s2();
  test_s3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_endian_swap_s1@plt>
mov    $0x0,%al
call   1050 <test_s2@plt>
mov    $0x0,%al
call   1040 <test_s3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_endian_swap_s1@plt>
xor    %eax,%eax
call   1050 <test_s2@plt>
xor    %eax,%eax
call   1040 <test_s3@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_endian_swap_s1()
%2 = tail call i32 (...) @test_s2()
%3 = tail call i32 (...) @test_s3()
ret i32 0
}
/* Type definitions */
struct rbtree {
  int dummy;
};
struct rbnode {
  int dummy;
};

/* Variables and functions */
struct rbnode *z_rb_get_minmax(struct rbtree *, int /*<<< orphan*/);
struct rbnode *rb_get_min(struct rbtree *tree) {
  return z_rb_get_minmax(tree, 0);
}


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

x86 assembly (clang, -O2):
<rb_get_min>:
xor    %esi,%esi
jmp    1030 <z_rb_get_minmax@plt>

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

LLVM IR (-O2):
%struct.rbnode = type { i32 }
%struct.rbtree = type { i32 }
define %struct.rbnode* @rb_get_min(%struct.rbtree* %0) {
%2 = tail call %struct.rbnode* @z_rb_get_minmax(%struct.rbtree* %0, i32 0)
ret %struct.rbnode* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int ft_init_line(char **line) {
  *line = (char *)malloc(sizeof(char) * 1);
  if (!*line)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_init_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114a <ft_init_line+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <ft_init_line+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_init_line>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_init_line(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = load i8**, i8*** %3
store i8* %5, i8** %6
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_init_line(i8** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 1)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %0
%4 = icmp eq i64 %2, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
double *zeros(int dim) {
  int i = 0;
  double *vector = (double *)malloc(sizeof(double) * dim);
  for (i = 0; i < dim; i++) {
    vector[i] = 0;
  }
  return vector;
}


x86 assembly (clang, -O0):
<zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <zeros+0x56>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <zeros+0x2c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeros>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <zeros+0x29>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double* @zeros(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to double*
store double* %10, double** %4
store i32 0, i32* %3
br label %11
11: ; preds = %20, %1
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = load double*, double** %4
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double 0.000000e+00, double* %19
br label %20
20: ; preds = %15
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
%24 = load double*, double** %4
ret double* %24
}

LLVM IR (-O2):
define double* @zeros(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = inttoptr i64 %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %5, %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
void GPIOModuleReset(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) |= ((0x00000002u));
  while (!((*((volatile unsigned int *)(baseAdd + (0x114)))) & (0x00000001u)))
    ;
}


x86 assembly (clang, -O0):
<GPIOModuleReset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x114,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <GPIOModuleReset+0x3a>
jmp    113f <GPIOModuleReset+0x3f>
jmp    1116 <GPIOModuleReset+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOModuleReset>:
lea    0x10(%rdi),%eax
orl    $0x2,(%rax)
add    $0x114,%edi
nopl   0x0(%rax)
testl  $0x1,(%rdi)
je     1110 <GPIOModuleReset+0x10>
ret

LLVM IR (-O0):
define void @GPIOModuleReset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 16
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %9
9: ; preds = %18, %1
%10 = load i32, i32* %2
%11 = add i32 %10, 276
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br i1 %17, label %18, label %19
18: ; preds = %9
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @GPIOModuleReset(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 2
store volatile i32 %6, i32* %4
%7 = add i32 %0, 276
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %10, %1
%11 = load volatile i32, i32* %9
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
ret void
}
float lerp(float x, float x1, float x2, float q00, float q01) {
  if ((x2 - x1) == 0)
    return q00;
  else
    return (((x2 - x) / (x2 - x1)) * q00) + (((x - x1) / (x2 - x1)) * q01);
}


x86 assembly (clang, -O0):
<lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1148 <lerp+0x48>
jp     1148 <lerp+0x48>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118f <lerp+0x8f>
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm3
subss  -0xc(%rbp),%xmm3
divss  %xmm3,%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerp>:
movaps %xmm2,%xmm5
subss  %xmm1,%xmm5
xorps  %xmm6,%xmm6
ucomiss %xmm6,%xmm5
jne    1115 <lerp+0x15>
jp     1115 <lerp+0x15>
movaps %xmm3,%xmm0
ret
subss  %xmm0,%xmm2
divss  %xmm5,%xmm2
subss  %xmm1,%xmm0
divss  %xmm5,%xmm0
mulss  %xmm4,%xmm0
mulss  %xmm3,%xmm2
addss  %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @lerp(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
%12 = load float, float* %9
%13 = load float, float* %8
%14 = fsub float %12, %13
%15 = fcmp oeq float %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %5
%17 = load float, float* %10
store float %17, float* %6
br label %37
18: ; preds = %5
%19 = load float, float* %9
%20 = load float, float* %7
%21 = fsub float %19, %20
%22 = load float, float* %9
%23 = load float, float* %8
%24 = fsub float %22, %23
%25 = fdiv float %21, %24
%26 = load float, float* %10
%27 = load float, float* %7
%28 = load float, float* %8
%29 = fsub float %27, %28
%30 = load float, float* %9
%31 = load float, float* %8
%32 = fsub float %30, %31
%33 = fdiv float %29, %32
%34 = load float, float* %11
%35 = fmul float %33, %34
%36 = call float @llvm.fmuladd.f32(float %25, float %26, float %35)
store float %36, float* %6
br label %37
37: ; preds = %18, %16
%38 = load float, float* %6
ret float %38
}

LLVM IR (-O2):
define float @lerp(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %2, %1
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = fsub float %2, %0
%10 = fdiv float %9, %6
%11 = fsub float %0, %1
%12 = fdiv float %11, %6
%13 = fmul float %12, %4
%14 = tail call float @llvm.fmuladd.f32(float %10, float %3, float %13)
br label %15
15: ; preds = %5, %8
%16 = phi float [ %14, %8 ], [ %3, %5 ]
ret float %16
}
/* Variables and functions */
int strcasecmp(char *, char *);
int c_comp(const void *s1, const void *s2) {
  return strcasecmp(*(char **)s1, *(char **)s2);
}


x86 assembly (clang, -O0):
<c_comp>:
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 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @c_comp(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 @strcasecmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @c_comp(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 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *rfile_fn_abs2rel(char const *, char *);
char *rfile_fn_dirname(char const *);
char *rfile_fn_abs2rel_file(const char *abs, const char *base_file) {
  char *base, *rel;
  if (base = rfile_fn_dirname(base_file), !base)
    return NULL;
  rel = rfile_fn_abs2rel(abs, base);
  free(base);
  return rel;
}


x86 assembly (clang, -O0):
<rfile_fn_abs2rel_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <rfile_fn_dirname@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1164 <rfile_fn_abs2rel_file+0x34>
jmp    1171 <rfile_fn_abs2rel_file+0x41>
movq   $0x0,-0x8(%rbp)
jmp    1193 <rfile_fn_abs2rel_file+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <rfile_fn_abs2rel@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfile_fn_abs2rel_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <rfile_fn_dirname@plt>
test   %rax,%rax
je     1162 <rfile_fn_abs2rel_file+0x32>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <rfile_fn_abs2rel@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1164 <rfile_fn_abs2rel_file+0x34>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rfile_fn_abs2rel_file(i8* %0, i8* %1) {
%3 = tail call i8* @rfile_fn_dirname(i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i8* @rfile_fn_abs2rel(i8* %0, i8* %3)
%7 = tail call i32 @free(i8* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn40() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn40");
  return result;
}


x86 assembly (clang, -O0):
<fn40>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn40>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn40\00"
define i8* @fn40() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn40\00"
define i8* @fn40() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *offtime_u(scalar_t__, long, struct tm *);
int /*<<< orphan*/ tzset();
struct tm *_gmtime_r(const time_t *timep, struct tm *p_tm) {
  tzset();
  return (offtime_u((time_t)*timep, 0L, p_tm));
}


x86 assembly (clang, -O0):
<_gmtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <tzset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <offtime_u@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gmtime_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <tzset@plt>
mov    (%rbx),%rdi
xor    %esi,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <offtime_u@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @_gmtime_r(i64* %0, %struct.tm* %1) {
%3 = alloca i64*
%4 = alloca %struct.tm*
store i64* %0, i64** %3
store %struct.tm* %1, %struct.tm** %4
%5 = call i32 (...) @tzset()
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = load %struct.tm*, %struct.tm** %4
%9 = call %struct.tm* @offtime_u(i64 %7, i64 0, %struct.tm* %8)
ret %struct.tm* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @_gmtime_r(i64* nocapture %0, %struct.tm* %1) {
%3 = tail call i32 (...) @tzset()
%4 = load i64, i64* %0
%5 = tail call %struct.tm* @offtime_u(i64 %4, i64 0, %struct.tm* %1)
ret %struct.tm* %5
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n = 100;
  char s[256];
  printf("%d\n", n);
  itoa(n, s);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1040 <itoa@plt>
lea    -0x110(%rbp),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    $0x64,%edi
mov    %rbx,%rsi
call   1050 <itoa@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 100, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @itoa(i32 %5, i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 100)
%4 = call i32 @itoa(i32 100, i8* %2)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
double SIM_power_sense_amp_delay(inrisetime, outrisetime)
double inrisetime, *outrisetime;
{
  *outrisetime = (7e-10 * 0.0875);
  return ((5.8e-10 * 0.0875));
}


x86 assembly (clang, -O0):
<SIM_power_sense_amp_delay>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  0xedb(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_sense_amp_delay>:
movabs $0x3dd0d615e8a0f102,%rax
d6 d0 3d
mov    %rax,(%rdi)
movsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @SIM_power_sense_amp_delay(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double*, double** %4
store double 6.125000e-11, double* %5
ret double 0x3DCBE66D72DED136
}

LLVM IR (-O2):
define double @SIM_power_sense_amp_delay(double %0, double* nocapture writeonly %1) {
store double 6.125000e-11, double* %1
ret double 0x3DCBE66D72DED136
}
/* Variables and functions */
scalar_t__ isHex(char *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int hexToDecimal(char *src) {
  if (isHex(src)) {
    int number = (int)strtol(src, NULL, 16);
    return number;
  }
}


x86 assembly (clang, -O0):
<hexToDecimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isHex@plt>
cmp    $0x0,%rax
je     115a <hexToDecimal+0x3a>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexToDecimal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <isHex@plt>
test   %rax,%rax
je     113f <hexToDecimal+0x1f>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <strtol@plt>
pop    %rbx
ret
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hexToDecimal(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @isHex(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strtol(i8* %9, i32* null, i32 16)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @hexToDecimal(i8* %0) {
%2 = tail call i64 @isHex(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 16)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ undef, %1 ]
ret i32 %8
}
/* Variables and functions */
int findMin(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int a[] = {5, 1, 2, 3, 4};
  printf("min = %d\n", findMin(a, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1040 <findMin@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <findMin@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 5, i32 1, i32 2, i32 3, i32 4]
@.str = [10 x i8] c"min = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @findMin(i32* %5, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void __umem_assert_failed(void) {}


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

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

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

LLVM IR (-O2):
define void @__umem_assert_failed() {
ret void
}
void scamper_do_sting_cleanup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @scamper_do_sting_cleanup() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strClone(const char *source) {
  char *clone = (char *)malloc(strlen(source) + 1);
  strcpy(clone, source);
  return clone;
}


x86 assembly (clang, -O0):
<strClone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strClone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strClone(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strClone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
double prefix(int character) {
  switch (character) {
  case 'k':
    return 1000.0;
  case 'm':
    return 0.001;
  case 'M':
    return 1000000.0;
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x4d,%eax
je     1161 <prefix+0x61>
jmp    111b <prefix+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x6b,%eax
je     113d <prefix+0x3d>
jmp    112c <prefix+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x6d,%eax
je     114f <prefix+0x4f>
jmp    1173 <prefix+0x73>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <prefix+0x7b>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <prefix+0x7b>
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117b <prefix+0x7b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
cmp    $0x4d,%edi
je     1118 <prefix+0x18>
cmp    $0x6b,%edi
je     1121 <prefix+0x21>
cmp    $0x6d,%edi
jne    112a <prefix+0x2a>
movsd  0xef9(%rip),%xmm0
ret
movsd  0xee8(%rip),%xmm0
ret
movsd  0xed7(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @prefix(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 107, label %5
i32 109, label %6
i32 77, label %7
]
5: ; preds = %1
store double 1.000000e+03, double* %2
br label %9
6: ; preds = %1
store double 1.000000e-03, double* %2
br label %9
7: ; preds = %1
store double 1.000000e+06, double* %2
br label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @prefix(i32 %0) {
switch i32 %0, label %4 [
i32 107, label %5
i32 109, label %2
i32 77, label %3
]
2: ; preds = %1
br label %5
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi double [ 0.000000e+00, %4 ], [ 1.000000e+06, %3 ], [ 1.000000e-03, %2 ], [ 1.000000e+03, %1 ]
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dsapxsumpw(int /*<<< orphan*/ const, float const,
                                 float const *, int /*<<< orphan*/ const);
double stdlib_strided_dsapxsum(const int64_t N, const float alpha,
                               const float *X, const int64_t stride) {
  return stdlib_strided_dsapxsumpw(N, alpha, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsapxsum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_dsapxsumpw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsapxsum>:
jmp    1030 <stdlib_strided_dsapxsumpw@plt>

LLVM IR (-O0):
define double @stdlib_strided_dsapxsum(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca float*
%8 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store float* %2, float** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load float, float* %6
%11 = load float*, float** %7
%12 = load i32, i32* %8
%13 = call double @stdlib_strided_dsapxsumpw(i32 %9, float %10, float* %11, i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @stdlib_strided_dsapxsum(i32 %0, float %1, float* %2, i32 %3) {
%5 = tail call double @stdlib_strided_dsapxsumpw(i32 %0, float %1, float* %2, i32 %3)
ret double %5
}
int GetPriority(char c) {
  if (c == '*' || c == '/') {
    return 2;
  }
  if (c == '+' || c == '-') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetPriority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1124 <GetPriority+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1130 <GetPriority+0x30>
movl   $0x2,-0x4(%rbp)
jmp    115d <GetPriority+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114a <GetPriority+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1156 <GetPriority+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <GetPriority+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPriority>:
add    $0xd6,%dil
xor    %eax,%eax
cmp    $0x5,%dil
ja     111a <GetPriority+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @GetPriority(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 47
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 2, i32* %2
br label %22
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 1, i32* %2
br label %22
21: ; preds = %16
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@switch.table.GetPriority = [6 x i32] [i32 2, i32 1, i32 0, i32 1, i32 0, i32 2]
define i32 @GetPriority(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.GetPriority, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ usleep(unsigned int);
void wait() {
  unsigned int time = 1000 + 9000 % ((unsigned int)rand());
  usleep(time);
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    $0x2328,%eax
xor    %edx,%edx
div    %ecx
add    $0x3e8,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rcx
mov    $0x2328,%eax
xor    %edx,%edx
div    %ecx
lea    0x3e8(%rdx),%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @wait() {
%1 = alloca i32
%2 = call i64 (...) @rand()
%3 = trunc i64 %2 to i32
%4 = urem i32 9000, %3
%5 = add i32 1000, %4
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @usleep(i32 %6)
ret void
}

LLVM IR (-O2):
define void @wait() {
%1 = tail call i64 (...) @rand()
%2 = trunc i64 %1 to i32
%3 = urem i32 9000, %2
%4 = add nuw nsw i32 %3, 1000
%5 = tail call i32 @usleep(i32 %4)
ret void
}
void SysMouseBToggle(int x) {}


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

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

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

LLVM IR (-O2):
define void @SysMouseBToggle(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setupFTM1();
void initializeReceiver() { setupFTM1(); }


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

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

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

LLVM IR (-O2):
define void @initializeReceiver() {
%1 = tail call i32 (...) @setupFTM1()
ret void
}