xunge/DecIR huggingface dataset:
/* Type definitions */
struct proto_identifier_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct proto_identifier_t *);
void pi_destroy(struct proto_identifier_t *p) { free(p); }


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

x86 assembly (clang, -O2):
<pi_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.proto_identifier_t = type { i32 }
define void @pi_destroy(%struct.proto_identifier_t* nocapture %0) {
%2 = tail call i32 @free(%struct.proto_identifier_t* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *strdup(char const *);
char *twopence_strdup(const char *s) {
  char *p = strdup(s);
  do {
    assert(p);
    return p;
  } while (0);
}


x86 assembly (clang, -O0):
<twopence_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twopence_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @twopence_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
br label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
br label %10
10: ; preds = %6
ret i8* %9
}

LLVM IR (-O2):
define i8* @twopence_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @assert(i8* %2)
ret i8* %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ print_tab(int *, char **, char *);
int /*<<< orphan*/ printf(char *);
int main(int ile_arg, char *arg[]) {
  printf("Podaj separator! :\n");
  char c;
  c = getchar();
  print_tab(&ile_arg, arg, &c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x11(%rbp),%rdx
call   1050 <print_tab@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0xb(%rsp)
lea    0xc(%rsp),%rdi
lea    0xb(%rsp),%rdx
mov    %rbx,%rsi
call   1050 <print_tab@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Podaj separator! :\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %5
%8 = load i8**, i8*** %4
%9 = call i32 @print_tab(i32* %3, i8** %8, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Podaj separator! :\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
store i8 %6, i8* %4
%7 = call i32 @print_tab(i32* %3, i8** %1, i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ strtod(char const *, char **);
float strtof(const char *nptr, char **endptr) {
  return (float)strtod(nptr, endptr);
}


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

x86 assembly (clang, -O2):
<strtof>:
push   %rax
call   1030 <strtod@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @strtof(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 = load i8**, i8*** %4
%7 = call i64 @strtod(i8* %5, i8** %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @strtof(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtod(i8* %0, i8** %1)
%4 = sitofp i64 %3 to float
ret float %4
}
void glutSetupVideoResizing(void) {}


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

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

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

LLVM IR (-O2):
define void @glutSetupVideoResizing() {
ret void
}
/* Variables and functions */
int clear_caselist(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc != 2) {
    usage();
    return (-1);
  }
  int ret = clear_caselist(argv[1]);
  return ret;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1153 <main+0x33>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <clear_caselist@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):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <clear_caselist@plt>
xor    %eax,%eax
call   1030 <usage@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @clear_caselist(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ -1, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void clad_xfree(void **ptrptr) {
  if (!ptrptr)
    return;
  free(*ptrptr);
  (*ptrptr) = NULL;
}


x86 assembly (clang, -O0):
<clad_xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <clad_xfree+0x1c>
jmp    1143 <clad_xfree+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_xfree>:
test   %rdi,%rdi
je     1129 <clad_xfree+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clad_xfree(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %3
ret void
}
int int_comp_func(void *data1, void *data2) {
  return (unsigned long)*((unsigned long *)data1) -
         (unsigned long)*((unsigned long *)data2);
}


x86 assembly (clang, -O0):
<int_comp_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_comp_func>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @int_comp_func(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_comp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int zero_or_ten(int);
void alloc_may_be_big_Good_FP() {
  malloc(zero_or_ten(1) * 100 * 1000 * 1000 + 1);
}


x86 assembly (clang, -O0):
<alloc_may_be_big_Good_FP>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <zero_or_ten@plt>
imul   $0x64,%eax,%eax
imul   $0x3e8,%eax,%eax
imul   $0x3e8,%eax,%edi
add    $0x1,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_may_be_big_Good_FP>:
push   %rax
mov    $0x1,%edi
call   1040 <zero_or_ten@plt>
imul   $0x5f5e100,%eax,%edi
or     $0x1,%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @alloc_may_be_big_Good_FP() {
%1 = call i32 @zero_or_ten(i32 1)
%2 = mul nsw i32 %1, 100
%3 = mul nsw i32 %2, 1000
%4 = mul nsw i32 %3, 1000
%5 = add nsw i32 %4, 1
%6 = call i32 @malloc(i32 %5)
ret void
}

LLVM IR (-O2):
define void @alloc_may_be_big_Good_FP() {
%1 = tail call i32 @zero_or_ten(i32 1)
%2 = mul i32 %1, 100000000
%3 = or i32 %2, 1
%4 = tail call i32 @malloc(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;

/* Variables and functions */
int /*<<< orphan*/ glCallList(int /*<<< orphan*/);
void CallList(GLuint list) { glCallList(list); }


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

x86 assembly (clang, -O2):
<CallList>:
jmp    1030 <glCallList@plt>

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

LLVM IR (-O2):
define void @CallList(i32 %0) {
%2 = tail call i32 @glCallList(i32 %0)
ret void
}
void RTTlsFree(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTlsFree() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void wail(void) { fprintf(stderr, "0000ooooooo.\n"); }


x86 assembly (clang, -O0):
<wail>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wail>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"0000ooooooo.\0A\00"
define void @wail() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"0000ooooooo.\0A\00"
define void @wail() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ mvaddch(scalar_t__, int, char);
int /*<<< orphan*/ refresh();
void erase_robot(int st, int ave) {
  mvaddch(LINES - (st * 2), ave * 2, '+');
  refresh();
}


x86 assembly (clang, -O0):
<erase_robot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%rdi
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
cltq
sub    %rax,%rdi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    $0x2b,%edx
call   1040 <mvaddch@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_robot>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%rax
add    %edi,%edi
movslq %edi,%rcx
sub    %rcx,%rax
add    %esi,%esi
mov    %rax,%rdi
mov    $0x2b,%edx
call   1040 <mvaddch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
@LINES = global i64 0
define void @erase_robot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i64, i64* @LINES
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = sub nsw i64 %5, %8
%10 = load i32, i32* %4
%11 = mul nsw i32 %10, 2
%12 = call i32 @mvaddch(i64 %9, i32 %11, i8 signext 43)
%13 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
define void @erase_robot(i32 %0, i32 %1) {
%3 = load i64, i64* @LINES
%4 = shl nsw i32 %0, 1
%5 = sext i32 %4 to i64
%6 = sub nsw i64 %3, %5
%7 = shl nsw i32 %1, 1
%8 = tail call i32 @mvaddch(i64 %6, i32 %7, i8 signext 43)
%9 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_significand();
scalar_t__ significand(double);
void test_significand(double d) {
  if (significand(d) != significand(d))
    link_failure_significand();
}


x86 assembly (clang, -O0):
<test_significand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <significand@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <significand@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_significand+0x3c>
mov    $0x0,%al
call   1040 <link_failure_significand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_significand>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <significand@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <significand@plt>
cmp    %rax,%rbx
jne    1149 <test_significand+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_significand@plt>

LLVM IR (-O0):
define void @test_significand(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @significand(double %3)
%5 = load double, double* %2
%6 = call i64 @significand(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_significand()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_significand(double %0) {
%2 = tail call i64 @significand(double %0)
%3 = tail call i64 @significand(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_significand()
br label %7
7: ; preds = %5, %1
ret void
}
void nested_loop_narrowing_Bad() {
  int i = 0;
  int a[10];
  while (1) {
    while (1) {
      a[i] = 0;
      for (i = 0; i < 10; i++) {
      }
    }
  }
}


x86 assembly (clang, -O0):
<nested_loop_narrowing_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <nested_loop_narrowing_Bad+0x10>
movslq -0x4(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1140 <nested_loop_narrowing_Bad+0x40>
jmp    1132 <nested_loop_narrowing_Bad+0x32>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <nested_loop_narrowing_Bad+0x23>
jmp    1110 <nested_loop_narrowing_Bad+0x10>

x86 assembly (clang, -O2):
<nested_loop_narrowing_Bad>:
jmp    1100 <nested_loop_narrowing_Bad>

LLVM IR (-O0):
define void @nested_loop_narrowing_Bad() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %0
br label %4
4: ; preds = %3, %15
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %6
store i32 0, i32* %7
store i32 0, i32* %1
br label %8
8: ; preds = %12, %4
%9 = load i32, i32* %1
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %15
11: ; preds = %8
br label %12
12: ; preds = %11
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %8
15: ; preds = %8
br label %4
}

LLVM IR (-O2):
define void @nested_loop_narrowing_Bad() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write32(FILE *out, uint32_t p) {
  unsigned char q[4];
  q[0] = p & 0xFF;
  q[1] = (p >> 8) & 0xFF;
  q[2] = (p >> 16) & 0xFF;
  q[3] = (p >> 24) & 0xFF;
  fwrite(q, 1, 4, out);
  return;
}


x86 assembly (clang, -O0):
<write32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xf(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0xd(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i8]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %13, i8* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %18, i8* %19
%20 = load i32, i32* %4
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 3
store i8 %23, i8* %24
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%26 = load i32*, i32** %3
%27 = call i32 @fwrite(i8* %25, i32 1, i32 4, i32* %26)
ret void
}

LLVM IR (-O2):
define void @write32(i32* nocapture %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %1, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %10, i8* %11
%12 = lshr i32 %1, 24
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %13, i8* %14
%15 = call i32 @fwrite(i8* %4, i32 1, i32 4, i32* %0)
ret void
}
/* Type definitions */
struct ip6_rthdr0 {
  int dummy;
};
struct in6_addr {
  int dummy;
};

/* Variables and functions */
size_t CMSG_SPACE(int);
#define IPV6_RTHDR_TYPE_0 128
size_t inet6_rthdr_space(int type, int seg) {
  switch (type) {
  case IPV6_RTHDR_TYPE_0:
    if (seg < 1 || seg > 23)
      return (0);
    return (
        CMSG_SPACE(sizeof(struct in6_addr) * seg + sizeof(struct ip6_rthdr0)));
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<inet6_rthdr_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    116e <inet6_rthdr_space+0x5e>
jmp    1131 <inet6_rthdr_space+0x21>
cmpl   $0x1,-0x10(%rbp)
jl     1145 <inet6_rthdr_space+0x35>
cmpl   $0x17,-0x10(%rbp)
jle    1152 <inet6_rthdr_space+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1176 <inet6_rthdr_space+0x66>
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    $0x4,%rax
mov    %eax,%edi
call   1030 <CMSG_SPACE@plt>
mov    %rax,-0x8(%rbp)
jmp    1176 <inet6_rthdr_space+0x66>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_rthdr_space>:
cmp    $0x80,%edi
jne    112c <inet6_rthdr_space+0x1c>
lea    -0x18(%rsi),%eax
cmp    $0xffffffe9,%eax
jb     112c <inet6_rthdr_space+0x1c>
lea    0x4(,%rsi,4),%edi
jmp    1030 <CMSG_SPACE@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @inet6_rthdr_space(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %21 [
i32 128, label %7
]
7: ; preds = %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 23
br i1 %12, label %13, label %14
13: ; preds = %10, %7
store i64 0, i64* %3
br label %22
14: ; preds = %10
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = mul i64 4, %16
%18 = add i64 %17, 4
%19 = trunc i64 %18 to i32
%20 = call i64 @CMSG_SPACE(i32 %19)
store i64 %20, i64* %3
br label %22
21: ; preds = %2
store i64 0, i64* %3
br label %22
22: ; preds = %21, %14, %13
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @inet6_rthdr_space(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 128
%4 = add i32 %1, -24
%5 = icmp ult i32 %4, -23
%6 = or i1 %3, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = shl nuw nsw i32 %1, 2
%9 = add nuw nsw i32 %8, 4
%10 = tail call i64 @CMSG_SPACE(i32 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i64 [ %10, %7 ], [ 0, %2 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void getFullFileNames(char *filename) {
  char filetmp[260];
  strcpy(filetmp, filename);
  filename[0] = '\0';
  sprintf(filename, "%s//%s", "/var/log/safed", filetmp);
}


x86 assembly (clang, -O0):
<getFullFileNames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rcx
lea    0xea8(%rip),%rsi
lea    0xea8(%rip),%rdx
call   1040 <sprintf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFullFileNames>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movb   $0x0,(%rbx)
lea    0xebb(%rip),%rsi
lea    0xebb(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rcx
call   1040 <sprintf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s//%s\00"
@.str.1 = [15 x i8] c"/var/log/safed\00"
define void @getFullFileNames(i8* %0) {
%2 = alloca i8*
%3 = alloca [260 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [260 x i8], [260 x i8]* %3, i64 0, i64 0
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s//%s\00"
@.str.1 = [15 x i8] c"/var/log/safed\00"
define void @getFullFileNames(i8* %0) {
%2 = alloca [260 x i8]
%3 = getelementptr inbounds [260 x i8], [260 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
store i8 0, i8* %0
%5 = call i32 @sprintf(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
double pathconN_nm3_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathconN_nm3_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm3_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm3_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathconN_nm3_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
int f(int x) {
  if (x >= 0) {
    return 2 * x;
  } else {
    return -x;
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111f <f+0x1f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <f+0x27>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rdi,%rdi,1),%ecx
mov    %edi,%eax
neg    %eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = shl nsw i32 %0, 1
%4 = sub nsw i32 0, %0
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
void INT_Excep_CMPB_CMPB0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CMPB_CMPB0() {
ret void
}
void UnmapScatterFragments(unsigned long *ptrEnt) {}


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

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

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

LLVM IR (-O2):
define void @UnmapScatterFragments(i64* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testSplitString1();
void testAll() {
  printf("Starter tests\n");
  printf("Udfører test 1...\n");
  testSplitString1();
}


x86 assembly (clang, -O0):
<testAll>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <testSplitString1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAll>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <testSplitString1@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Starter tests\0A\00"
@.str.1 = [20 x i8] c"Udf\C3\B8rer test 1...\0A\00"
define void @testAll() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @testSplitString1()
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Starter tests\00"
@str.2 = [19 x i8] c"Udf\C3\B8rer test 1...\00"
define void @testAll() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @testSplitString1()
ret void
}
/* Variables and functions */
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int open(char *, int);
int /*<<< orphan*/ perror(char *);
int serial_open(char *dev) {
  int fd = open(dev, O_RDWR | O_NOCTTY | O_NDELAY);
  if (fd == -1) {
    perror("Can't open the port!");
    return -1;
  } else
    return fd;
}


x86 assembly (clang, -O0):
<serial_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1175 <serial_open+0x55>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <serial_open+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_open>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e96(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     114c <serial_open+0x2c>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
jmp    1148 <serial_open+0x28>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str = [21 x i8] c"Can't open the port!\00"
define i32 @serial_open(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_NOCTTY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_NDELAY
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %5, i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %18
16: ; preds = %1
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@.str = [21 x i8] c"Can't open the port!\00"
define i32 @serial_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %1, %9
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ e_xxxra(int, void *, int, int);
void e_movar(int rs, void *addr) { e_xxxra(rs, addr, 0xA3, 0x89); }


x86 assembly (clang, -O0):
<e_movar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xa3,%edx
mov    $0x89,%ecx
call   1030 <e_xxxra@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_movar>:
mov    $0xa3,%edx
mov    $0x89,%ecx
jmp    1030 <e_xxxra@plt>

LLVM IR (-O0):
define void @e_movar(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 @e_xxxra(i32 %5, i8* %6, i32 163, i32 137)
ret void
}

LLVM IR (-O2):
define void @e_movar(i32 %0, i8* %1) {
%3 = tail call i32 @e_xxxra(i32 %0, i8* %1, i32 163, i32 137)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pcspeaker_play(int, int);
void my_beep_func() {
  pcspeaker_play(500, 250);
  return;
}


x86 assembly (clang, -O0):
<my_beep_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f4,%edi
mov    $0xfa,%esi
call   1030 <pcspeaker_play@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_beep_func>:
mov    $0x1f4,%edi
mov    $0xfa,%esi
jmp    1030 <pcspeaker_play@plt>

LLVM IR (-O0):
define void @my_beep_func() {
%1 = call i32 @pcspeaker_play(i32 500, i32 250)
ret void
}

LLVM IR (-O2):
define void @my_beep_func() {
%1 = tail call i32 @pcspeaker_play(i32 500, i32 250)
ret void
}
/* Variables and functions */
int dysize(int);
int dmsize(int m, int y) {
  static char sizes[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  if (m == 1)
    return (dysize(y) == 366) ? 29 : 28;
  else
    return sizes[m];
}


x86 assembly (clang, -O0):
<dmsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114d <dmsize+0x3d>
mov    -0xc(%rbp),%edi
call   1030 <dysize@plt>
mov    %eax,%edx
mov    $0x1c,%eax
mov    $0x1d,%ecx
cmp    $0x16e,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <dmsize+0x4f>
movslq -0x8(%rbp),%rcx
lea    0x2ed0(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmsize>:
push   %rax
cmp    $0x1,%edi
jne    112f <dmsize+0x1f>
mov    %esi,%edi
call   1030 <dysize@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x16e,%ecx
sete   %al
or     $0x1c,%eax
pop    %rcx
ret
movslq %edi,%rax
lea    0xec7(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rcx
ret

LLVM IR (-O0):
@dmsize.sizes = internal global [12 x i8] c"\1F\1C\1F\1E\1F\1E\1F\1F\1E\1F\1E\1F"
define i32 @dmsize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %5
%10 = call i32 @dysize(i32 %9)
%11 = icmp eq i32 %10, 366
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 29, i32 28
store i32 %13, i32* %3
br label %20
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [12 x i8], [12 x i8]* @dmsize.sizes, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@dmsize.sizes = internal unnamed_addr constant [12 x i8] c"\1F\1C\1F\1E\1F\1E\1F\1F\1E\1F\1E\1F"
define i32 @dmsize(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @dysize(i32 %1)
%6 = icmp eq i32 %5, 366
%7 = select i1 %6, i32 29, i32 28
br label %13
8: ; preds = %2
%9 = sext i32 %0 to i64
%10 = getelementptr inbounds [12 x i8], [12 x i8]* @dmsize.sizes, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %8, %4
%14 = phi i32 [ %7, %4 ], [ %12, %8 ]
ret i32 %14
}
void RTTcpWriteNB(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpWriteNB() {
ret void
}
extern void defineStaticVarInExtern() {
  static const int x = 0;
  static int y = 0;
}


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

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

LLVM IR (-O0):
@defineStaticVarInExtern.x = internal constant i32 0
@defineStaticVarInExtern.y = internal global i32 0
define void @defineStaticVarInExtern() {
ret void
}

LLVM IR (-O2):
define void @defineStaticVarInExtern() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void usage() {
  fatal("usage: standfeat [-statsfile <str>]\n\t[-infile <str> "
        "(REQUIRED)]\n\t[-outfile <str> (REQUIRED)]\n\t[-vadfile <str>]\n\t[-D "
        "<n> (defaults to 39)]");
}


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

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

LLVM IR (-O0):
@.str = [138 x i8] c"usage: standfeat [-statsfile <str>]\0A\09[-infile <str> (REQUIRED)]\0A\09[-outfile <str> (REQUIRED)]\0A\09[-vadfile <str>]\0A\09[-D <n> (defaults to 39)]\00"
define void @usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"usage: standfeat [-statsfile <str>]\0A\09[-infile <str> (REQUIRED)]\0A\09[-outfile <str> (REQUIRED)]\0A\09[-vadfile <str>]\0A\09[-D <n> (defaults to 39)]\00"
define void @usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int useconds_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delay(useconds_t mseconds) { usleep(mseconds * 1000); }


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

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int b64_out_buffer_size(int in_buffer_size) {
  int padding = 3 - in_buffer_size % 3;
  if (padding == 3)
    padding = 0;
  return ((in_buffer_size + (padding)) / 3 * 4);
}


x86 assembly (clang, -O0):
<b64_out_buffer_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    $0x3,%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    112d <b64_out_buffer_size+0x2d>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_out_buffer_size>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    $0x3,%ecx
sub    %edx,%ecx
test   %edx,%edx
cmove  %edx,%ecx
add    %eax,%ecx
movslq %ecx,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @b64_out_buffer_size(i32 %0) {
%2 = srem i32 %0, 3
%3 = sub nsw i32 3, %2
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 0, i32 %3
%6 = add nsw i32 %5, %0
%7 = sdiv i32 %6, 3
%8 = shl nsw i32 %7, 2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int __attribute__((no)) fn2(void) {
  foo(3);
  return 0;
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
push   %rax
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn2() {
%1 = call i32 @foo(i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @fn2() {
%1 = tail call i32 @foo(i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LPTMR0_DriverIRQHandler();
__attribute__((weak)) void LPTMR0_IRQHandler(void) {
  LPTMR0_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @LPTMR0_IRQHandler() {
%1 = tail call i32 (...) @LPTMR0_DriverIRQHandler()
ret void
}
int configUnusedFunc() {
  int unused;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @configUnusedFunc() {
%1 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @configUnusedFunc() {
ret i32 0
}
/* Variables and functions */
int errno;
int posix_memalign(void **, size_t, size_t);
void *PINT_mem_aligned_alloc(size_t size, size_t alignment) {
  int ret;
  void *ptr;
  ret = posix_memalign(&ptr, alignment, size);
  if (ret != 0) {
    errno = ret;
    return NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<PINT_mem_aligned_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x28(%rbp),%rdi
call   1030 <posix_memalign@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1157 <PINT_mem_aligned_alloc+0x47>
mov    -0x1c(%rbp),%ecx
mov    0x2e98(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    115f <PINT_mem_aligned_alloc+0x4f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PINT_mem_aligned_alloc>:
push   %rax
mov    %rdi,%rdx
mov    %rsp,%rdi
call   1030 <posix_memalign@plt>
test   %eax,%eax
je     112d <PINT_mem_aligned_alloc+0x1d>
mov    0x2eb9(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i8* @PINT_mem_aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = call i32 @posix_memalign(i8** %7, i64 %8, i64 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %6
store i32 %14, i32* @errno
store i8* null, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %7
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %13
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @PINT_mem_aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
store i32 %5, i32* @errno
br label %10
8: ; preds = %2
%9 = load i8*, i8** %3
br label %10
10: ; preds = %8, %7
%11 = phi i8* [ null, %7 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ HF_memcmp(void const *, void const *, size_t,
                             int /*<<< orphan*/, uintptr_t);
int /*<<< orphan*/ instrumentConstAvail();
void __sanitizer_weak_hook_bcmp(uintptr_t pc, const void *m1, const void *m2,
                                size_t n, int result __attribute__((unused))) {
  HF_memcmp(m1, m2, n, instrumentConstAvail(), pc);
}


x86 assembly (clang, -O0):
<__sanitizer_weak_hook_bcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1040 <instrumentConstAvail@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
mov    -0x8(%rbp),%r8
call   1030 <HF_memcmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sanitizer_weak_hook_bcmp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %eax,%eax
call   1040 <instrumentConstAvail@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
mov    %r12,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <HF_memcmp@plt>

LLVM IR (-O0):
define void @__sanitizer_weak_hook_bcmp(i64 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i64 %0, i64* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i64, i64* %9
%14 = call i32 (...) @instrumentConstAvail()
%15 = load i64, i64* %6
%16 = call i32 @HF_memcmp(i8* %11, i8* %12, i64 %13, i32 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @__sanitizer_weak_hook_bcmp(i64 %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 (...) @instrumentConstAvail()
%7 = tail call i32 @HF_memcmp(i8* %1, i8* %2, i64 %3, i32 %6, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int cblat3_() {
  MAIN__();
  return 0;
}


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

x86 assembly (clang, -O2):
<cblat3_>:
push   %rax
xor    %eax,%eax
call   1030 <MAIN__@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cblat3_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @cblat3_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
void foo8() {}


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

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

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

LLVM IR (-O2):
define void @foo8() {
ret void
}