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

/* Variables and functions */
int uwsgi_stats_comma(struct uwsgi_stats *);
int uwsgi_stats_keylong(struct uwsgi_stats *, char *, unsigned long long);
int uwsgi_stats_keylong_comma(struct uwsgi_stats *us, char *key,
                              unsigned long long num) {
  int ret = uwsgi_stats_keylong(us, key, num);
  if (ret)
    return -1;
  return uwsgi_stats_comma(us);
}


x86 assembly (clang, -O0):
<uwsgi_stats_keylong_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <uwsgi_stats_keylong@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115e <uwsgi_stats_keylong_comma+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <uwsgi_stats_keylong_comma+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <uwsgi_stats_comma@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_stats_keylong_comma>:
push   %rbx
mov    %rdi,%rbx
call   1030 <uwsgi_stats_keylong@plt>
test   %eax,%eax
je     1134 <uwsgi_stats_keylong_comma+0x14>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <uwsgi_stats_comma@plt>

LLVM IR (-O0):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keylong_comma(%struct.uwsgi_stats* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.uwsgi_stats*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store %struct.uwsgi_stats* %0, %struct.uwsgi_stats** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = call i32 @uwsgi_stats_keylong(%struct.uwsgi_stats* %9, i8* %10, i64 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %19
16: ; preds = %3
%17 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%18 = call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keylong_comma(%struct.uwsgi_stats* %0, i8* %1, i64 %2) {
%4 = tail call i32 @uwsgi_stats_keylong(%struct.uwsgi_stats* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_add_position();
int main() {
  test_add_position();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_add_position()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CmdLO_Get(char *);
int atoi(int /*<<< orphan*/);
int CmdLO_GetInt(char *name) { return atoi(CmdLO_Get(name)); }


x86 assembly (clang, -O0):
<CmdLO_GetInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CmdLO_Get@plt>
mov    %eax,%edi
call   1040 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CmdLO_GetInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @CmdLO_Get(i8* %3)
%5 = call i32 @atoi(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CmdLO_GetInt(i8* %0) {
%2 = tail call i32 @CmdLO_Get(i8* %0)
%3 = tail call i32 @atoi(i32 %2)
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int stringToInt(char *s) {
  int retour = atoi(s);
  printf("%d\n", retour);
  return retour;
}


x86 assembly (clang, -O0):
<stringToInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringToInt>:
push   %rbx
call   1040 <atoi@plt>
mov    %eax,%ebx
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @stringToInt(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
char *SeekBufEnd(char *buf) {
  while (*buf != 0)
    buf++;
  return buf;
}


x86 assembly (clang, -O0):
<SeekBufEnd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <SeekBufEnd+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <SeekBufEnd+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @SeekBufEnd(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, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ glColor4sv(short *);
void Color4sv(short v[4]) { glColor4sv(v); }


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

x86 assembly (clang, -O2):
<Color4sv>:
jmp    1030 <glColor4sv@plt>

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

LLVM IR (-O2):
define void @Color4sv(i16* %0) {
%2 = tail call i32 @glColor4sv(i16* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int fun_stub_base_2_stub(int a, int b) {
  printf("fun_stub_base_2_stub:a = %d, b = %d\n", a, b);
  return a + b;
}


x86 assembly (clang, -O0):
<fun_stub_base_2_stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_stub_base_2_stub>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"fun_stub_base_2_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_2_stub(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 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [37 x i8] c"fun_stub_base_2_stub:a = %d, b = %d\0A\00"
define i32 @fun_stub_base_2_stub(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ isendwin();
int /*<<< orphan*/ refresh();
void shutdown(void) {
  if (!isendwin()) {
    clear();
    refresh();
    endwin();
  }
}


x86 assembly (clang, -O0):
<shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <isendwin@plt>
cmp    $0x0,%eax
jne    1169 <shutdown+0x29>
mov    $0x0,%al
call   1050 <clear@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdown>:
push   %rax
xor    %eax,%eax
call   1060 <isendwin@plt>
test   %eax,%eax
je     114e <shutdown+0xe>
pop    %rax
ret
xor    %eax,%eax
call   1050 <clear@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <endwin@plt>

LLVM IR (-O0):
define void @shutdown() {
%1 = call i32 (...) @isendwin()
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 (...) @clear()
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @endwin()
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @shutdown() {
%1 = tail call i32 (...) @isendwin()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @clear()
%5 = tail call i32 (...) @refresh()
%6 = tail call i32 (...) @endwin()
br label %7
7: ; preds = %3, %0
ret void
}
int count_char(char *str, char c) {
  int total = 0;
  while (*str != '\0') {
    total += (*str == c);
    str++;
  }
  return total;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <count_char+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_char+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int Maxi(int, int /*<<< orphan*/);
int /*<<< orphan*/ Mini(int, int);
int Clampi(int v, int min, int max) { return Maxi(min, Mini(v, max)); }


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

x86 assembly (clang, -O2):
<Clampi>:
push   %rbx
mov    %esi,%ebx
mov    %edx,%esi
call   1040 <Mini@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Maxi@plt>

LLVM IR (-O0):
define i32 @Clampi(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = call i32 @Mini(i32 %8, i32 %9)
%11 = call i32 @Maxi(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Clampi(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Mini(i32 %0, i32 %2)
%5 = tail call i32 @Maxi(i32 %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
char *astrcat(char *, char *);
char *Op_cat(char *arg1, char *arg2) { return astrcat(arg1, arg2); }


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

x86 assembly (clang, -O2):
<Op_cat>:
jmp    1030 <astrcat@plt>

LLVM IR (-O0):
define i8* @Op_cat(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 i8* @astrcat(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @Op_cat(i8* %0, i8* %1) {
%3 = tail call i8* @astrcat(i8* %0, i8* %1)
ret i8* %3
}
void s2e_message(const char *message) {
  __s2e_touch_string(message);
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x10, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       :
                       : "a"(message));
}


x86 assembly (clang, -O0):
<s2e_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <__s2e_touch_string@plt>
mov    -0x8(%rbp),%rax
(bad)
add    %dl,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_message>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__s2e_touch_string@plt>
mov    %rbx,%rax
(bad)
add    %dl,(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @s2e_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %3)
%5 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @s2e_message(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @__s2e_touch_string to i32 (i8*, ...)*)(i8* %0)
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x10, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "{ax},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_no_overflow_1(char *y) {
  char x[5] = "12";
  if (strlen(y) == 2)
    strncat(x, y, strlen(y));
}


x86 assembly (clang, -O0):
<strncat_no_overflow_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1178 <strncat_no_overflow_1+0x58>
lea    -0xd(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_no_overflow_1>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xc(%rsp)
movl   $0x3231,0x8(%rsp)
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1156 <strncat_no_overflow_1+0x36>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strncat_no_overflow_1.x = [5 x i8] c"12\00\00\00"
define void @strncat_no_overflow_1(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
store i8* %0, i8** %2
%4 = bitcast [5 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @strncat(i8* %9, i8* %10, i32 %12)
br label %14
14: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.strncat_no_overflow_1.x = [5 x i8] c"12\00\00\00"
define void @strncat_no_overflow_1(i8* %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = call i32 @strncat(i8* %3, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
void append_void(void) {}


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

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

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

LLVM IR (-O2):
define void @append_void() {
ret void
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
int t(struct can_frame frame) { return frame.data[0] >> 4 & 0x1; }


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x4,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
mov    (%rdi),%eax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i32 @t(i32* %0) {
%2 = alloca %struct.can_frame
%3 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
store i32* %0, i32** %3
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %2, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = ashr i32 %7, 4
%9 = and i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @t(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = lshr i32 %2, 4
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t ec_double_256(uint64_t R[12], uint64_t S[12]) {
  R[0] = S[2] + S[6];
  return 0;
}


x86 assembly (clang, -O0):
<ec_double_256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%rax
add    0x30(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_double_256>:
mov    0x30(%rsi),%rax
add    0x10(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ec_double_256(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 2
%7 = load i64, i64* %6
%8 = load i64*, i64** %4
%9 = getelementptr inbounds i64, i64* %8, i64 6
%10 = load i64, i64* %9
%11 = add nsw i64 %7, %10
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
store i64 %11, i64* %13
ret i64 0
}

LLVM IR (-O2):
define i64 @ec_double_256(i64* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 2
%4 = load i64, i64* %3
%5 = getelementptr inbounds i64, i64* %1, i64 6
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
store i64 %7, i64* %0
ret i64 0
}
/* Variables and functions */
char getchar();
void clean_up(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clean_up>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clean_up+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clean_up+0x21>
jmp    1119 <clean_up+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_up>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clean_up+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clean_up() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clean_up() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free2(void **p) {
  free(p[0]);
  free(p);
}


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

x86 assembly (clang, -O2):
<free2>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free2(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
/* Type definitions */
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atrf_rx_mode(struct atrf_dsc *, int);
int /*<<< orphan*/ atrf_tx(struct atrf_dsc *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void transmit_hmac(struct atrf_dsc *dsc, const char *msg) {
  atrf_rx_mode(dsc, 1);
  atrf_tx(dsc, msg, strlen(msg));
  atrf_rx_mode(dsc, 0);
}


x86 assembly (clang, -O0):
<transmit_hmac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <atrf_rx_mode@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <atrf_tx@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <atrf_rx_mode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transmit_hmac>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%esi
call   1040 <atrf_rx_mode@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <atrf_tx@plt>
mov    %rbx,%rdi
xor    %esi,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <atrf_rx_mode@plt>

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
define void @transmit_hmac(%struct.atrf_dsc* %0, i8* %1) {
%3 = alloca %struct.atrf_dsc*
%4 = alloca i8*
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %3
store i8* %1, i8** %4
%5 = load %struct.atrf_dsc*, %struct.atrf_dsc** %3
%6 = call i32 @atrf_rx_mode(%struct.atrf_dsc* %5, i32 1)
%7 = load %struct.atrf_dsc*, %struct.atrf_dsc** %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @atrf_tx(%struct.atrf_dsc* %7, i8* %8, i32 %10)
%12 = load %struct.atrf_dsc*, %struct.atrf_dsc** %3
%13 = call i32 @atrf_rx_mode(%struct.atrf_dsc* %12, i32 0)
ret void
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
define void @transmit_hmac(%struct.atrf_dsc* %0, i8* %1) {
%3 = tail call i32 @atrf_rx_mode(%struct.atrf_dsc* %0, i32 1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @atrf_tx(%struct.atrf_dsc* %0, i8* %1, i32 %4)
%6 = tail call i32 @atrf_rx_mode(%struct.atrf_dsc* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage_exit(const char *argv0) {
  fprintf(stderr,
          "Usage: \"%s [-r] src-addr dest-addr [blocksize [delay]]\", where -r "
          "sets RT priority and addr is [tcp:|udp:]ip-addr:port or "
          "[file:]filename\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [139 x i8] c"Usage: \22%s [-r] src-addr dest-addr [blocksize [delay]]\22, where -r sets RT priority and addr is [tcp:|udp:]ip-addr:port or [file:]filename\0A\00"
define void @usage_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [139 x i8] c"Usage: \22%s [-r] src-addr dest-addr [blocksize [delay]]\22, where -r sets RT priority and addr is [tcp:|udp:]ip-addr:port or [file:]filename\0A\00"
define void @usage_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int tan(double);
double math_cot(double x) { return 1 / tan(x); }


x86 assembly (clang, -O0):
<math_cot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <tan@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_cot>:
push   %rax
call   1030 <tan@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @math_cot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @tan(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @math_cot(double %0) {
%2 = tail call i32 @tan(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
void gtk_text_view_get_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_window() {
ret void
}
/* Variables and functions */
bool nrf52_errata_16(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_16() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
void next(void) {
  char ch;
  printf("Press Enter to continue ");
  do {
    scanf("%c", &ch);
  } while (ch != '\n');
  printf("\f");
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1134 <next+0x14>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%r14
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmpb   $0xa,0x7(%rsp)
jne    1150 <next+0x20>
mov    $0xc,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Press Enter to continue \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0C\00"
define void @next() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %5, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %3, label %9
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Press Enter to continue \00"
@.str.1 = [3 x i8] c"%c\00"
define void @next() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = call i32 @putchar(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
void cant_change(int *x, int *z) {
  x = z;
  printf("\n Swap cant_change: %p \n", x);
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"\0A Swap cant_change: %p \0A\00"
define void @cant_change(i32* nocapture readnone %0, i32* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int main(void) {
  if (foo(0x80) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 128)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 128)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int main(int argc, const char *argv[]) {
  int a[10];
  a[0] = 0;
  a[1] = 1;
  a[2] = 2;
  a[3] = 3;
  a[4] = 4;
  a[5] = 5;
  a[6] = 6;
  a[7] = 7;
  a[8] = 8;
  a[9] = 9;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x2,-0x38(%rbp)
movl   $0x3,-0x34(%rbp)
movl   $0x4,-0x30(%rbp)
movl   $0x5,-0x2c(%rbp)
movl   $0x6,-0x28(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x8,-0x20(%rbp)
movl   $0x9,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct prefix_ipv4 {
  int dummy;
};
struct prefix {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ prefix_free(struct prefix *);
void prefix_ipv4_free(struct prefix_ipv4 *p) {
  prefix_free((struct prefix *)p);
}


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

x86 assembly (clang, -O2):
<prefix_ipv4_free>:
jmp    1030 <prefix_free@plt>

LLVM IR (-O0):
%struct.prefix_ipv4 = type { i32 }
%struct.prefix = type { i32 }
define void @prefix_ipv4_free(%struct.prefix_ipv4* %0) {
%2 = alloca %struct.prefix_ipv4*
store %struct.prefix_ipv4* %0, %struct.prefix_ipv4** %2
%3 = load %struct.prefix_ipv4*, %struct.prefix_ipv4** %2
%4 = bitcast %struct.prefix_ipv4* %3 to %struct.prefix*
%5 = call i32 @prefix_free(%struct.prefix* %4)
ret void
}

LLVM IR (-O2):
%struct.prefix_ipv4 = type { i32 }
%struct.prefix = type { i32 }
define void @prefix_ipv4_free(%struct.prefix_ipv4* %0) {
%2 = bitcast %struct.prefix_ipv4* %0 to %struct.prefix*
%3 = tail call i32 @prefix_free(%struct.prefix* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fetch_page(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int count = argc;
  ++count;
  ++argv;
  while (*argv)
    fetch_page(*argv++);
  return 0;
}


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    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     116d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <fetch_page@plt>
jmp    1141 <main+0x31>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1141 <main+0x31>
mov    %rsi,%rbx
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <fetch_page@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
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
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i32 1
store i8** %11, i8*** %5
br label %12
12: ; preds = %16, %2
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %5
%19 = load i8*, i8** %17
%20 = ptrtoint i8* %19 to i32
%21 = call i32 @fetch_page(i32 %20)
br label %12
22: ; preds = %12
ret i32 0
}

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 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %13, %6 ], [ %4, %2 ]
%8 = phi i8** [ %12, %6 ], [ %3, %2 ]
%9 = ptrtoint i8* %7 to i64
%10 = trunc i64 %9 to i32
%11 = tail call i32 @fetch_page(i32 %10)
%12 = getelementptr inbounds i8*, i8** %8, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret i32 0
}
void gdk_atom_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_atom_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aa_endconv_st_be(void *, float *, int);
void aa_endconv_st_be_s(void *dst, float src) {
  aa_endconv_st_be(dst, &src, sizeof(float));
}


x86 assembly (clang, -O0):
<aa_endconv_st_be_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <aa_endconv_st_be@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_endconv_st_be_s>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <aa_endconv_st_be@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @aa_endconv_st_be_s(i8* %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i32 @aa_endconv_st_be(i8* %0, float* %3, i32 4)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_execute_Inquiry(char *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  test_execute_Inquiry(argv[1], 0, 0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <test_execute_Inquiry@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <test_execute_Inquiry@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 @test_execute_Inquiry(i8* %8, i32 0, i32 0)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
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 @test_execute_Inquiry(i8* %4, i32 0, i32 0)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void newline() {
  unsigned char *lctr;
  unsigned char sp;
  unsigned char c;
  lctr = (unsigned char *)0x0140;
  sp = 64 - *lctr;
  for (c = 0; c < sp; c++) {
    print(" ");
  }
  *lctr = 0;
}


x86 assembly (clang, -O0):
<newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x140,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    $0x40,%eax
sub    %ecx,%eax
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jge    115f <newline+0x4f>
lea    0xeb3(%rip),%rdi
call   1030 <print@plt>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1136 <newline+0x26>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newline>:
push   %r14
push   %rbx
push   %rax
mov    0x140,%bl
cmp    $0x40,%bl
je     113c <newline+0x2c>
add    $0xc0,%bl
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <print@plt>
inc    %bl
jne    1130 <newline+0x20>
movb   $0x0,0x140
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @newline() {
%1 = load i8, i8* inttoptr (i64 320 to i8*)
%2 = icmp eq i8 %1, 64
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = sub i8 64, %1
br label %5
5: ; preds = %3, %5
%6 = phi i8 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = add nuw i8 %6, 1
%9 = icmp eq i8 %8, %4
br i1 %9, label %10, label %5
10: ; preds = %5, %0
store i8 0, i8* inttoptr (i64 320 to i8*)
ret void
}
/* Variables and functions */
int errno;
int syscall(int, int, int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int waitpid(int pid, int *stat, int opt) {
  int ret = syscall(104, pid, (int)stat, opt, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x68,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1165 <waitpid+0x55>
xor    %ecx,%ecx
sub    -0x18(%rbp),%ecx
mov    0x2e89(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <waitpid+0x5b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x68,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     112e <waitpid+0x1e>
pop    %rcx
ret
neg    %eax
mov    0x2ea9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = ptrtoint i32* %10 to i32
%12 = load i32, i32* %7
%13 = call i32 @syscall(i32 104, i32 %9, i32 %11, i32 %12, i32 0, i32 0)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = load i32, i32* %8
%18 = sub nsw i32 0, %17
store i32 %18, i32* @errno
store i32 -1, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @syscall(i32 104, i32 %0, i32 %5, i32 %2, i32 0, i32 0)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sub nsw i32 0, %6
store i32 %9, i32* @errno
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ -1, %8 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRINTERSECTCLIPRECT_swap(char *record, int torev) {
  core4_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRINTERSECTCLIPRECT_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRINTERSECTCLIPRECT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int array[10];
  int *a = array + 1;
  int *p = a - 1;
  *p = 0;
  test_assert(array[0] == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x0,(%rax)
cmpl   $0x0,-0x30(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 -1
store i32* %8, i32** %4
%9 = load i32*, i32** %4
store i32 0, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}