xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "convertconf [-b] ircd.conf.old ircd.conf.new\n");
  fprintf(stderr,
          "   -b - this will run in 'basic' mode and not add extra blocks\n");
  fprintf(stderr,
          "        such as general{}, channel{} etc. (Used for EFNet)\n");
  exit(-1);
}


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    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"convertconf [-b] ircd.conf.old ircd.conf.new\0A\00"
@.str.1 = [64 x i8] c" -b - this will run in 'basic' mode and not add extra blocks\0A\00"
@.str.2 = [60 x i8] c" such as general{}, channel{} etc. (Used for EFNet)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"convertconf [-b] ircd.conf.old ircd.conf.new\0A\00"
@.str.1 = [64 x i8] c" -b - this will run in 'basic' mode and not add extra blocks\0A\00"
@.str.2 = [60 x i8] c" such as general{}, channel{} etc. (Used for EFNet)\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct rq_term {
  int dummy;
};

/* Variables and functions */
short rq_term_get_days_period(struct rq_term *);
short rq_term_compare(struct rq_term *term1, struct rq_term *term2) {
  return (rq_term_get_days_period(term1) - rq_term_get_days_period(term2));
}


x86 assembly (clang, -O0):
<rq_term_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rq_term_get_days_period@plt>
cwtl
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rq_term_get_days_period@plt>
mov    %ax,%cx
mov    -0x14(%rbp),%eax
movswl %cx,%ecx
sub    %ecx,%eax
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_term_compare>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <rq_term_get_days_period@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rq_term_get_days_period@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.rq_term = type { i32 }
define signext i16 @rq_term_compare(%struct.rq_term* %0, %struct.rq_term* %1) {
%3 = alloca %struct.rq_term*
%4 = alloca %struct.rq_term*
store %struct.rq_term* %0, %struct.rq_term** %3
store %struct.rq_term* %1, %struct.rq_term** %4
%5 = load %struct.rq_term*, %struct.rq_term** %3
%6 = call signext i16 @rq_term_get_days_period(%struct.rq_term* %5)
%7 = sext i16 %6 to i32
%8 = load %struct.rq_term*, %struct.rq_term** %4
%9 = call signext i16 @rq_term_get_days_period(%struct.rq_term* %8)
%10 = sext i16 %9 to i32
%11 = sub nsw i32 %7, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
%struct.rq_term = type { i32 }
define signext i16 @rq_term_compare(%struct.rq_term* %0, %struct.rq_term* %1) {
%3 = tail call signext i16 @rq_term_get_days_period(%struct.rq_term* %0)
%4 = tail call signext i16 @rq_term_get_days_period(%struct.rq_term* %1)
%5 = sub i16 %3, %4
ret i16 %5
}
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
scalar_t__ statfs(char const *, struct statfs *);
int isNFS(const char *path) {
  struct statfs statfsbuf;
  if (statfs(path, &statfsbuf) < 0)
    return 1;
  if (statfsbuf.f_type == 0x6969)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isNFS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <statfs@plt>
cmp    $0x0,%rax
jge    113f <isNFS+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    115f <isNFS+0x4f>
cmpl   $0x6969,-0x18(%rbp)
jne    1158 <isNFS+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <isNFS+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNFS>:
push   %rax
mov    %rsp,%rsi
call   1030 <statfs@plt>
test   %rax,%rax
sets   %al
cmpl   $0x6969,(%rsp)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
define i32 @isNFS(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.statfs
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @statfs(i8* %5, %struct.statfs* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %15
9: ; preds = %1
%10 = getelementptr inbounds %struct.statfs, %struct.statfs* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 26985
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %15
14: ; preds = %9
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
define i32 @isNFS(i8* %0) {
%2 = alloca %struct.statfs
%3 = bitcast %struct.statfs* %2 to i8*
%4 = call i64 @statfs(i8* %0, %struct.statfs* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 26985
%9 = select i1 %5, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int V1 = 1, V2 = 2, V3 = 4, V4 = 10, V5 = 2;
  int V6 = (V1, (V2, V3), (V4, V5, V3));
  printf("%d\n", V6);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
void input_layer_1_D(float in, float *out) { *out = in; }


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

x86 assembly (clang, -O2):
<input_layer_1_D>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @input_layer_1_D(float %0, float* nocapture writeonly %1) {
store float %0, float* %1
ret void
}
/* Variables and functions */
char *ap_str_trim_head_from_set(char *, char const *);
char *ap_str_trim_tail_from_set(char *, char const *);
char *ap_str_trim_from_set(char *str, const char *set) {
  if (str == NULL || set == NULL) {
    goto finish;
  }
  str = ap_str_trim_head_from_set(str, set);
  str = ap_str_trim_tail_from_set(str, set);
finish:
  return str;
}


x86 assembly (clang, -O0):
<ap_str_trim_from_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <ap_str_trim_from_set+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    114b <ap_str_trim_from_set+0x2b>
jmp    116d <ap_str_trim_from_set+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <ap_str_trim_head_from_set@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ap_str_trim_tail_from_set@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_str_trim_from_set>:
push   %rbx
test   %rdi,%rdi
je     1142 <ap_str_trim_from_set+0x22>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1142 <ap_str_trim_from_set+0x22>
mov    %rbx,%rsi
call   1040 <ap_str_trim_head_from_set@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ap_str_trim_tail_from_set@plt>
mov    %rdi,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ap_str_trim_from_set(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 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %18
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i8* @ap_str_trim_head_from_set(i8* %12, i8* %13)
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i8* @ap_str_trim_tail_from_set(i8* %15, i8* %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %11, %10
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @ap_str_trim_from_set(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i8* @ap_str_trim_head_from_set(i8* %0, i8* %1)
%8 = tail call i8* @ap_str_trim_tail_from_set(i8* %7, i8* %1)
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %0, %2 ], [ %8, %6 ]
ret i8* %10
}
int test_imm_69int8_mem(signed char *val) {
  return ((*val) & (0x69 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_69int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 105
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ mmalloc(int const);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *mstrdup(const char *s) {
  const int len = strlen(s);
  char *new_s = (char *)mmalloc(len + 1);
  if (new_s) {
    strcpy(new_s, s);
    return new_s;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<mstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <mmalloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117c <mstrdup+0x4c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <mstrdup+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <mmalloc@plt>
test   %rax,%rax
je     1159 <mstrdup+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115b <mstrdup+0x2b>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = call i64 @mmalloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
store i8* %18, i8** %2
br label %20
19: ; preds = %1
store i8* null, i8** %2
br label %20
20: ; preds = %19, %14
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @mstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @mmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help() {
  printf("\n--Interconnect shell--\n");
  printf("\n");
  printf(
      "The avaiable commands are: 			\n\t--list	"
      "			\n\t--quit				\n\t--help\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A--Interconnect shell--\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [64 x i8] c"The avaiable commands are: \09\09\09\0A\09--list\09\09\09\09\0A\09--quit\09\09\09\09\0A\09--help\0A\00"
define i32 @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"\0A--Interconnect shell--\00"
@str.3 = [63 x i8] c"The avaiable commands are: \09\09\09\0A\09--list\09\09\09\09\0A\09--quit\09\09\09\09\0A\09--help\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int bios_normalize(int n, int up) {
  int temp_n = n & ~((1 << 12) - 1);
  if (up && (n % (1 << 12)))
    temp_n += (1 << 12);
  return temp_n;
}


x86 assembly (clang, -O0):
<bios_normalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff000,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113e <bios_normalize+0x3e>
mov    -0x4(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113e <bios_normalize+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bios_normalize>:
mov    %edi,%ecx
and    $0xfffff000,%ecx
lea    0x1000(%rcx),%eax
test   $0xfff,%edi
cmove  %ecx,%eax
test   %esi,%esi
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bios_normalize(i32 %0, i32 %1) {
%3 = and i32 %0, -4096
%4 = icmp eq i32 %1, 0
%5 = and i32 %0, 4095
%6 = icmp eq i32 %5, 0
%7 = or i1 %4, %6
%8 = add nsw i32 %3, 4096
%9 = select i1 %7, i32 %3, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void put_line(int space) {
  int pass;
  pass = 0;
  while (pass < space) {
    ft_putchar(' ');
    pass++;
  }
}


x86 assembly (clang, -O0):
<put_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <put_line+0x36>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <put_line+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_line>:
push   %rbx
test   %edi,%edi
jle    112f <put_line+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <put_line+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @put_line(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = call i32 @ft_putchar(i8 signext 32)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @put_line(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @ft_putchar(i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int print_s(char *input) {
  int ps = 0;
  while (*input) {
    write(1, input, 1);
    input++;
    ps++;
  }
  return ps;
}


x86 assembly (clang, -O0):
<print_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <print_s+0x4a>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_s+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_s>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1144 <print_s+0x34>
mov    %rdi,%r14
xor    %eax,%eax
xchg   %ax,%ax
mov    %rax,%rbx
lea    (%r14,%rax,1),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
lea    0x1(%rbx),%rax
cmpb   $0x0,0x1(%r14,%rbx,1)
jne    1120 <print_s+0x10>
jmp    1146 <print_s+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @print_s(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 1)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add nuw nsw i32 %5, 1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %13
}
unsigned char *findRet(void *endAddr) {
  unsigned char *retInstAddr = endAddr;
  while (*retInstAddr != 0xc3) {
    retInstAddr--;
  }
  return retInstAddr;
}


x86 assembly (clang, -O0):
<findRet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xc3,%eax
je     1133 <findRet+0x33>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <findRet+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findRet>:
mov    %rdi,%rax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0xc3,-0x1(%rax)
lea    -0x1(%rax),%rax
jne    1110 <findRet+0x10>
ret

LLVM IR (-O0):
define i8* @findRet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp ne i32 %8, 195
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @findRet(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, -61
%6 = getelementptr inbounds i8, i8* %3, i64 -1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
void createWriteBuffer(char *buffer) {}


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

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

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

LLVM IR (-O2):
define void @createWriteBuffer(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int hash_string(char *);
int hash_struct(void *m) {
  char *n = *(char **)m;
  return hash_string(n) & 127;
}


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

x86 assembly (clang, -O2):
<hash_struct>:
push   %rax
mov    (%rdi),%rdi
call   1030 <hash_string@plt>
and    $0x7f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_struct(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @hash_string(i8* %7)
%9 = and i32 %8, 127
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash_struct(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @hash_string(i8* %3)
%5 = and i32 %4, 127
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ translateCSV(char *, double *, int *);
void csvToDarray(char numbersCSV[], double numbers[], int *count) {
  translateCSV(numbersCSV, numbers, count);
}


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

x86 assembly (clang, -O2):
<csvToDarray>:
jmp    1030 <translateCSV@plt>

LLVM IR (-O0):
define void @csvToDarray(i8* %0, double* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i32*
store i8* %0, i8** %4
store double* %1, double** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load double*, double** %5
%9 = load i32*, i32** %6
%10 = call i32 @translateCSV(i8* %7, double* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @csvToDarray(i8* %0, double* %1, i32* %2) {
%4 = tail call i32 @translateCSV(i8* %0, double* %1, i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ check(char);
int FAT_check_character(char chk) { return (check(chk)) ? -1 : 0; }


x86 assembly (clang, -O0):
<FAT_check_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <check@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FAT_check_character>:
push   %rax
call   1030 <check@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FAT_check_character(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @check(i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @FAT_check_character(i8 signext %0) {
%2 = tail call i64 @check(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct stack_impl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stack_impl_ops__destructor(struct stack_impl *stack_impl) {
  printf("stack_impl::_destructor()\n");
}


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

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

LLVM IR (-O0):
%struct.stack_impl = type { i32 }
@.str = [27 x i8] c"stack_impl::_destructor()\0A\00"
define void @stack_impl_ops__destructor(%struct.stack_impl* %0) {
%2 = alloca %struct.stack_impl*
store %struct.stack_impl* %0, %struct.stack_impl** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.stack_impl = type { i32 }
@str = [26 x i8] c"stack_impl::_destructor()\00"
define void @stack_impl_ops__destructor(%struct.stack_impl* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void date_output_hour_error(char *function_name, int hour) {
  fprintf(stderr, "ERROR in %s(): daylight savings time hour problem = %d.\n",
          function_name, hour);
}


x86 assembly (clang, -O0):
<date_output_hour_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_output_hour_error>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"ERROR in %s(): daylight savings time hour problem = %d.\0A\00"
define void @date_output_hour_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"ERROR in %s(): daylight savings time hour problem = %d.\0A\00"
define void @date_output_hour_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_setfontsize(int, int);
void j_setfontsize(int arg0, int arg1) { japi_setfontsize(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_setfontsize>:
jmp    1030 <japi_setfontsize@plt>

LLVM IR (-O0):
define void @j_setfontsize(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 @japi_setfontsize(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setfontsize(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setfontsize(i32 %0, i32 %1)
ret void
}
void convert_accelerometer_data(struct ssp_data *data) { return; }


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define void @convert_accelerometer_data(%struct.ssp_data* %0) {
%2 = alloca %struct.ssp_data*
store %struct.ssp_data* %0, %struct.ssp_data** %2
ret void
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define void @convert_accelerometer_data(%struct.ssp_data* nocapture %0) {
ret void
}
int unsupported_function(void *obj, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unsupported_function(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u_char;

/* Variables and functions */
int cbmarch_parallel_burst_read_track(int, int /*<<< orphan*/ *, unsigned int);
int cbm_parallel_burst_read_track(int HandleDevice, __u_char *Buffer,
                                  unsigned int Length) {
  ;
  return cbmarch_parallel_burst_read_track(HandleDevice, Buffer, Length);
}


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

x86 assembly (clang, -O2):
<cbm_parallel_burst_read_track>:
jmp    1030 <cbmarch_parallel_burst_read_track@plt>

LLVM IR (-O0):
define i32 @cbm_parallel_burst_read_track(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32 @cbmarch_parallel_burst_read_track(i32 %7, i32* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @cbm_parallel_burst_read_track(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @cbmarch_parallel_burst_read_track(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, char *,
                           int);
void fprintf_t() {
  FILE *fp;
  fp = fopen("file.txt", "w+");
  fprintf(fp, "%s %s %s %d", "We", "are", "in", 2012);
  fclose(fp);
}


x86 assembly (clang, -O0):
<fprintf_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
lea    0xeb7(%rip),%rdx
lea    0xeb3(%rip),%rcx
lea    0xeb0(%rip),%r8
mov    $0x7dc,%r9d
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintf_t>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rsi
lea    0xec3(%rip),%rdx
lea    0xebf(%rip),%rcx
lea    0xebc(%rip),%r8
mov    %rax,%rdi
mov    $0x7dc,%r9d
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [12 x i8] c"%s %s %s %d\00"
@.str.3 = [3 x i8] c"We\00"
@.str.4 = [4 x i8] c"are\00"
@.str.5 = [3 x i8] c"in\00"
define void @fprintf_t() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2012)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [12 x i8] c"%s %s %s %d\00"
@.str.3 = [3 x i8] c"We\00"
@.str.4 = [4 x i8] c"are\00"
@.str.5 = [3 x i8] c"in\00"
define void @fprintf_t() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2012)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
cbuf26(f, n) { return (cbuf(f, n, 26)); }


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

x86 assembly (clang, -O2):
<cbuf26>:
mov    $0x1a,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf26(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 26)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf26(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 26)
ret i32 %3
}
/* Variables and functions */
int syscall(int, char const *, size_t);
int setdomainname(const char *name, size_t len) {
  return syscall(121, name, len);
}


x86 assembly (clang, -O0):
<setdomainname>:
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    $0x79,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setdomainname>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x79,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setdomainname(i8* %0, i64 %1) {
%3 = tail call i32 @syscall(i32 121, i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
struct stat {
  long st_atime;
  long st_ctime;
  long st_mtime;
};

/* Variables and functions */
long get_time(struct stat file_info, char flg) {
  switch (flg) {
  case 'a':
    return (file_info.st_atime);
  case 'c':
    return (file_info.st_ctime);
  default:
    return (file_info.st_mtime);
  }
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
lea    0x10(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x61,%eax
je     1138 <get_time+0x38>
jmp    1127 <get_time+0x27>
mov    -0x10(%rbp),%eax
sub    $0x63,%eax
je     1148 <get_time+0x48>
jmp    1159 <get_time+0x59>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <get_time+0x65>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <get_time+0x65>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
lea    0x8(%rsp),%rax
cmp    $0x63,%edi
je     1113 <get_time+0x13>
cmp    $0x61,%edi
jne    111b <get_time+0x1b>
mov    (%rax),%rax
ret
add    $0x8,%rax
mov    (%rax),%rax
ret
add    $0x10,%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.stat = type { i64, i64, i64 }
define i64 @get_time(%struct.stat* byval(%struct.stat) align 8 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %13 [
i32 97, label %7
i32 99, label %10
]
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%9 = load i64, i64* %8
store i64 %9, i64* %3
br label %16
10: ; preds = %2
%11 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 1
%12 = load i64, i64* %11
store i64 %12, i64* %3
br label %16
13: ; preds = %2
%14 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 2
%15 = load i64, i64* %14
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %10, %7
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
%struct.stat = type { i64, i64, i64 }
define i64 @get_time(%struct.stat* nocapture byval(%struct.stat) align 8 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
switch i32 %3, label %8 [
i32 97, label %4
i32 99, label %6
]
4: ; preds = %2
%5 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
br label %10
6: ; preds = %2
%7 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
br label %10
8: ; preds = %2
%9 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
br label %10
10: ; preds = %8, %6, %4
%11 = phi i64* [ %9, %8 ], [ %7, %6 ], [ %5, %4 ]
%12 = load i64, i64* %11
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int read_i2c_reg(int, int, int /*<<< orphan*/ *);
int piups_get_vaux1conv(int file_i2c, uint16_t *vaux1conv) {
  return read_i2c_reg(file_i2c, 0x54, vaux1conv);
}


x86 assembly (clang, -O0):
<piups_get_vaux1conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x54,%esi
call   1030 <read_i2c_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piups_get_vaux1conv>:
mov    %rsi,%rdx
mov    $0x54,%esi
jmp    1030 <read_i2c_reg@plt>

LLVM IR (-O0):
define i32 @piups_get_vaux1conv(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 @read_i2c_reg(i32 %5, i32 84, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @piups_get_vaux1conv(i32 %0, i32* %1) {
%3 = tail call i32 @read_i2c_reg(i32 %0, i32 84, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ btrace_add(char *, int, char *, char const *);
void warn_truncated(const char *where) {
  btrace_add("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/jjgreen/cptutils/refs/heads/master/src/"
             "common/ggr.c",
             106, "unexpected end of file %s", where);
}


x86 assembly (clang, -O0):
<warn_truncated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x6a,%esi
lea    0xf5b(%rip),%rdx
call   1030 <btrace_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_truncated>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xf6d(%rip),%rdx
mov    $0x6a,%esi
jmp    1030 <btrace_add@plt>

LLVM IR (-O0):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jjgreen/cptutils/refs/heads/master/src/common/ggr.c\00"
@.str.1 = [26 x i8] c"unexpected end of file %s\00"
define void @warn_truncated(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @btrace_add(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [142 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jjgreen/cptutils/refs/heads/master/src/common/ggr.c\00"
@.str.1 = [26 x i8] c"unexpected end of file %s\00"
define void @warn_truncated(i8* %0) {
%2 = tail call i32 @btrace_add(i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int gcd(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) { return gcd(atoi(argv[1]), atoi(argv[2])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <gcd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <gcd@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = call i32 @gcd(i32 %9, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @gcd(i32 %5, i32 %8)
ret i32 %9
}
void __xassert_failed(char *expr, const char *file, int line, char *func) {
  error("%s:%d: %s(): Assertion (%s) failed.", file, line, func, expr);
  log_flush();
  abort();
}


x86 assembly (clang, -O0):
<__xassert_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1050 <error@plt>
mov    $0x0,%al
call   1040 <log_flush@plt>
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<__xassert_failed>:
push   %rax
mov    %rdi,%r8
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <error@plt>
xor    %eax,%eax
call   1040 <log_flush@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"%s:%d: %s(): Assertion (%s) failed.\00"
define void @__xassert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
%14 = call i32 (...) @log_flush()
unreachable
}

LLVM IR (-O2):
@.str = [36 x i8] c"%s:%d: %s(): Assertion (%s) failed.\00"
define void @__xassert_failed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
%6 = tail call i32 (...) @log_flush()
tail call void @abort()
unreachable
}
/* Variables and functions */
char *strchr(char const *, char);
const char *skip_intl_qualifier_prefix(const char *str) {
  const char *ptr;
  if (*str != '?') {
    return str;
  } else if ((ptr = strchr(str, ':'))) {
    return (ptr + 1);
  } else {
    return str;
  }
}


x86 assembly (clang, -O0):
<skip_intl_qualifier_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3f,%eax
je     1139 <skip_intl_qualifier_prefix+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <skip_intl_qualifier_prefix+0x5e>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1166 <skip_intl_qualifier_prefix+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116e <skip_intl_qualifier_prefix+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_intl_qualifier_prefix>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x3f,(%rdi)
jne    1131 <skip_intl_qualifier_prefix+0x21>
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_intl_qualifier_prefix(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 63
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i8* @strchr(i8* %0, i8 signext 58)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
br label %9
9: ; preds = %4, %1
%10 = phi i8* [ %0, %1 ], [ %8, %4 ]
ret i8* %10
}