xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sig_unblock(int signum) {
  sigset_t ss;
  sigemptyset(&ss);
  sigprocmask(SIG_SETMASK, 0, &ss);
  sigdelset(&ss, signum);
  sigprocmask(SIG_BLOCK, &ss, 0);
}


x86 assembly (clang, -O0):
<sig_unblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigdelset@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_unblock>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <sigdelset@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIG_SETMASK = global i32 0
@SIG_BLOCK = global i32 0
define void @sig_unblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* @SIG_SETMASK
%6 = call i32 @sigprocmask(i32 %5, i32* null, i32* %3)
%7 = load i32, i32* %2
%8 = call i32 @sigdelset(i32* %3, i32 %7)
%9 = load i32, i32* @SIG_BLOCK
%10 = call i32 @sigprocmask(i32 %9, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_SETMASK = global i32 0
@SIG_BLOCK = global i32 0
define void @sig_unblock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = load i32, i32* @SIG_SETMASK
%6 = call i32 @sigprocmask(i32 %5, i32* null, i32* %2)
%7 = call i32 @sigdelset(i32* %2, i32 %0)
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32* null)
ret void
}
unsigned Bit(int x) { return (1 << x); }


x86 assembly (clang, -O0):
<Bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @Bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @Bit(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ret_timing(int);
void i_nop(void) { ret_timing(4); }


x86 assembly (clang, -O0):
<i_nop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <ret_timing@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_nop>:
mov    $0x4,%edi
jmp    1030 <ret_timing@plt>

LLVM IR (-O0):
define void @i_nop() {
%1 = call i32 @ret_timing(i32 4)
ret void
}

LLVM IR (-O2):
define void @i_nop() {
%1 = tail call i32 @ret_timing(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __environ;
int execvep(char const *, char *const *, int /*<<< orphan*/);
int execvp(__const char *path, char *__const argv[]) {
  return execvep(path, argv, __environ);
}


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

x86 assembly (clang, -O2):
<execvp>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <execvep@plt>

LLVM IR (-O0):
@__environ = global i32 0
define i32 @execvp(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 = load i32, i32* @__environ
%8 = call i32 @execvep(i8* %5, i8** %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@__environ = global i32 0
define i32 @execvp(i8* %0, i8** %1) {
%3 = load i32, i32* @__environ
%4 = tail call i32 @execvep(i8* %0, i8** %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int atoi(char *);
int wSearchSort(char *s) { return atoi(s); }


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

x86 assembly (clang, -O2):
<wSearchSort>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @wSearchSort(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
char *gdb_continue(int sig, long addr) {}


x86 assembly (clang, -O0):
<gdb_continue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @gdb_continue(i32 %0, i64 %1) {
ret i8* undef
}
int do_182() { return 182; }


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

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

LLVM IR (-O0):
define i32 @do_182() {
ret i32 182
}

LLVM IR (-O2):
define i32 @do_182() {
ret i32 182
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main2() {
  puts("main2");
  return 2;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"main2\00"
define i32 @main2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
int string_array_len(const char **array) {
  int i = 0;
  if (array) {
    while (array[i])
      ++i;
  }
  return i;
}


x86 assembly (clang, -O0):
<string_array_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <string_array_len+0x45>
jmp    111f <string_array_len+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1140 <string_array_len+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <string_array_len+0x1f>
jmp    1145 <string_array_len+0x45>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_array_len>:
test   %rdi,%rdi
je     111e <string_array_len+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <string_array_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_array_len(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
int test_imm_EAuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xea,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EAuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15335424
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
void shoppingSnacks(int *prices, int n, int w) {
  int row = n;
  int column = 3 * w + 1;
  bool **p;
  p = (bool **)malloc(sizeof(bool) * row * column);
  printf("%d", n);
}


x86 assembly (clang, -O0):
<shoppingSnacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
movslq -0x18(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shoppingSnacks>:
push   %rbx
mov    %esi,%ebx
lea    (%rdx,%rdx,2),%edi
add    $0x1,%edi
imul   %esi,%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
lea    0xec5(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @shoppingSnacks(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = mul nsw i32 3, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = mul i64 4, %15
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = mul i64 %16, %18
%20 = trunc i64 %19 to i32
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to i32**
store i32** %22, i32*** %9
%23 = load i32, i32* %5
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @shoppingSnacks(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, 3
%5 = add nsw i32 %4, 1
%6 = shl i32 %1, 2
%7 = mul i32 %6, %5
%8 = tail call i64 @malloc(i32 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ vovowels(char *);
int main(void) {
  char *phrase = "Weg mit den Vokalen in Fredonia!";
  puts("Vor der Saeuberung:\n");
  puts(phrase);
  vovowels(phrase);
  puts("\nNach der Saeuberung:\n");
  puts(phrase);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1040 <vovowels@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <vovowels@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Weg mit den Vokalen in Fredonia!\00"
@.str.1 = [21 x i8] c"Vor der Saeuberung:\0A\00"
@.str.2 = [23 x i8] c"\0ANach der Saeuberung:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @vovowels(i8* %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = call i32 @puts(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Weg mit den Vokalen in Fredonia!\00"
@.str.1 = [21 x i8] c"Vor der Saeuberung:\0A\00"
@.str.2 = [23 x i8] c"\0ANach der Saeuberung:\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @vovowels(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
void strcmp_diff_length_2() {
  char *x = "12345";
  char *y = "123";
  if (strcmp(x, y) != 1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcmp_diff_length_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%eax
je     1144 <strcmp_diff_length_2+0x34>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"123\00"
define void @strcmp_diff_length_2() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %3, i8* %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcmp_diff_length_2() {
ret void
}
int nn_xpush_ispeer(int socktype) { return socktype == (5 * 16 + 1) ? 1 : 0; }


x86 assembly (clang, -O0):
<nn_xpush_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x51,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nn_xpush_ispeer>:
xor    %eax,%eax
cmp    $0x51,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @nn_xpush_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 81
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xpush_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 81
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_str(char *);
int /*<<< orphan*/ print_unint(int);
void print_int(int n) {
  if (n == -2147483647)
    print_str("-2147483647");
  if (n < 0)
    print_char('-'), n *= -1;
  print_unint((int)n);
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x80000001,-0x4(%rbp)
jne    1154 <print_int+0x24>
lea    0xeb1(%rip),%rdi
call   1040 <print_str@plt>
cmpl   $0x0,-0x4(%rbp)
jge    1171 <print_int+0x41>
mov    $0x2d,%edi
mov    $0x0,%al
call   1050 <print_char@plt>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <print_unint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %rbx
mov    %edi,%ebx
cmp    $0x80000001,%edi
jne    1149 <print_int+0x19>
lea    0xebe(%rip),%rdi
call   1040 <print_str@plt>
jmp    114d <print_int+0x1d>
test   %ebx,%ebx
jns    115b <print_int+0x2b>
mov    $0x2d,%edi
xor    %eax,%eax
call   1050 <print_char@plt>
neg    %ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_unint@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"-2147483647\00"
define void @print_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -2147483647
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @print_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 45)
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, -1
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %7
%15 = load i32, i32* %2
%16 = call i32 @print_unint(i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"-2147483647\00"
define void @print_int(i32 %0) {
%2 = icmp eq i32 %0, -2147483647
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @print_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %3, %5
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_char to i32 (i32, ...)*)(i32 45)
%9 = sub nsw i32 0, %0
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %9, %7 ], [ %0, %5 ]
%12 = tail call i32 @print_unint(i32 %11)
ret void
}
int inbyte(void) {
  volatile int *rxstat;
  volatile int *rxadata;
  int rxmask;
  rxstat = (int *)0x01F800E8;
  rxadata = (int *)0x01F800E0;
  rxmask = 1;
  while ((*rxstat & rxmask) == 0)
    ;
  return *rxadata;
}


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f800e8,%eax
mov    %rax,-0x8(%rbp)
mov    $0x1f800e0,%eax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0x14(%rbp),%eax
cmp    $0x0,%eax
jne    1134 <inbyte+0x34>
jmp    111d <inbyte+0x1d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
testl  $0x1,0x1f800e8
je     1100 <inbyte>
mov    0x1f800e0,%eax
ret

LLVM IR (-O0):
define i32 @inbyte() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* inttoptr (i64 33030376 to i32*), i32** %1
store i32* inttoptr (i64 33030368 to i32*), i32** %2
store i32 1, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32*, i32** %1
%6 = load volatile i32, i32* %5
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %4
br label %4
11: ; preds = %4
%12 = load i32*, i32** %2
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @inbyte() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 33030376 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 33030368 to i32*)
ret i32 %6
}
void *test_anti_range_99(signed char n) {
  extern void *alloc_anti_range_99(signed char) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_99(n);
}


x86 assembly (clang, -O0):
<test_anti_range_99>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     113d <test_anti_range_99+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jg     113d <test_anti_range_99+0x2d>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_99@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_99>:
cmp    $0x3,%dil
mov    $0xff,%eax
cmovae %edi,%eax
movsbl %al,%edi
jmp    1030 <alloc_anti_range_99@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_99(i8 signext %0) {
%2 = icmp ult i8 %0, 3
%3 = select i1 %2, i8 -1, i8 %0
%4 = tail call i8* @alloc_anti_range_99(i8 signext %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ D(char *);
void ipfw_config_nat(int ac, char **av) { D("unsupported"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"unsupported\00"
define void @ipfw_config_nat(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @D(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"unsupported\00"
define void @ipfw_config_nat(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @D(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void DieWithUserMessage(const char *message, const char *detail) {
  fprintf(stderr, "%s:%s\n", message, detail);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%s\0A\00"
define void @DieWithUserMessage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s:%s\0A\00"
define void @DieWithUserMessage(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
double Double__PLUS_(double x, double y) { return x + y; }


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

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

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

LLVM IR (-O2):
define double @Double__PLUS_(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("usage: %s <command> [argument]...\n", argv[0]);
    exit(EINVAL);
  }
  execvp(argv[1], argv + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    116a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1147 <main+0x17>
mov    0x8(%rsi),%rdi
add    $0x8,%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage: %s <command> [argument]...\0A\00"
@EINVAL = global i32 0
define i32 @main(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 = icmp slt i32 %5, 2
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EINVAL
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = call i32 @execvp(i8* %17, i8** %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"usage: %s <command> [argument]...\0A\00"
@EINVAL = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EINVAL
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @execvp(i8* %11, i8** %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ utf32_is_non_character(unsigned long);
int utf32_is_valid(unsigned long cp) {
  return cp < 0x10ffffU && !utf32_is_non_character(cp);
}


x86 assembly (clang, -O0):
<utf32_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x10ffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jae    1143 <utf32_is_valid+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <utf32_is_non_character@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_is_valid>:
xor    %eax,%eax
cmp    $0x10fffe,%rdi
ja     112e <utf32_is_valid+0x1e>
push   %rax
call   1030 <utf32_is_non_character@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @utf32_is_valid(i64 %0) {
%2 = icmp ult i64 %0, 1114111
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @utf32_is_non_character(i64 %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int __mkostemps(char *, int /*<<< orphan*/, int);
int mkostemp(char *template, int flags) {
  return __mkostemps(template, 0, flags);
}


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

x86 assembly (clang, -O2):
<mkostemp>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <__mkostemps@plt>

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

LLVM IR (-O2):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 @__mkostemps(i8* %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = atoi("1234567890");
  printf("%d\n", a);
  a = atoi("1234abc567890");
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x499602d2,%esi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [14 x i8] c"1234abc567890\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1234567890)
%2 = tail call i32 @atoi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int _atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  if (argc > 1)
    printf("%d\n", _atoi(argv[1]));
  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)
cmpl   $0x1,-0x8(%rbp)
jle    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <_atoi@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     113d <main+0x1d>
mov    0x8(%rsi),%rdi
call   1030 <_atoi@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@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 i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @_atoi(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @_atoi(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %4, %2
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned long, unsigned long,
                          unsigned long);
scalar_t__ pthread_self();
void printids(const char *s) {
  pid_t pid;
  pthread_t tid;
  pid = getpid();
  tid = pthread_self();
  printf("%s pid %lu tid %lu (0x%lx)\n", s, (unsigned long)pid,
         (unsigned long)tid, (unsigned long)tid);
}


x86 assembly (clang, -O0):
<printids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %rax,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%lx)\0A\00"
define void @printids(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = load i64, i64* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i64 %9, i64 %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s pid %lu tid %lu (0x%lx)\0A\00"
define void @printids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %2, i64 %3, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, float);
int /*<<< orphan*/ strcpy(char *, char *);
void fval_to_str(float x, int ndp, char *str) {
  if (x == (-999999)) {
    strcpy(str, "?");
  } else {
    sprintf(str, "%.*f", ndp, x);
  }
}


x86 assembly (clang, -O0):
<fval_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xebf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1165 <fval_to_str+0x45>
jp     1165 <fval_to_str+0x45>
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    117d <fval_to_str+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%edx
movss  -0x4(%rbp),%xmm0
lea    0xe8e(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fval_to_str>:
mov    %rsi,%rax
ucomiss 0xed6(%rip),%xmm0
jne    113d <fval_to_str+0x1d>
jp     113d <fval_to_str+0x1d>
lea    0xecf(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
mov    %edi,%edx
lea    0xec0(%rip),%rsi
mov    %rax,%rdi
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"?\00"
@.str.1 = [5 x i8] c"%.*f\00"
define void @fval_to_str(float %0, i32 %1, i8* %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i8*
store float %0, float* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load float, float* %4
%8 = fcmp oeq float %7, -9.999990e+05
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
12: ; preds = %3
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = load float, float* %4
%16 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %14, float %15)
br label %17
17: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
@.str.1 = [5 x i8] c"%.*f\00"
define void @fval_to_str(float %0, i32 %1, i8* %2) {
%4 = fcmp oeq float %0, -9.999990e+05
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %3
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, float %0)
br label %9
9: ; preds = %7, %5
ret void
}
int FracToPc(float f) {
  if (f < 0.0)
    return (int)(100.0f * f - .5f);
  else
    return (int)(100.0f * f + .5f);
}


x86 assembly (clang, -O0):
<FracToPc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1148 <FracToPc+0x48>
movss  -0x8(%rbp),%xmm0
movss  0xed4(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed0(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <FracToPc+0x6c>
movss  -0x8(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea3(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FracToPc>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
mulss  0xeed(%rip),%xmm0
lea    0xeea(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @FracToPc(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 1.000000e+02, float %8, float -5.000000e-01)
%10 = fptosi float %9 to i32
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load float, float* %3
%13 = call float @llvm.fmuladd.f32(float 1.000000e+02, float %12, float 5.000000e-01)
%14 = fptosi float %13 to i32
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @FracToPc(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+02, float -5.000000e-01)
%4 = tail call float @llvm.fmuladd.f32(float %0, float 1.000000e+02, float 5.000000e-01)
%5 = select i1 %2, float %3, float %4
%6 = fptosi float %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *build_array(int size) {
  int *new_array;
  if ((new_array = (int *)calloc(size, sizeof(int))) != NULL)
    return (new_array);
  else {
    printf("**** Problems: It was not possible to create dynamic array \n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<build_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1160 <build_array+0x30>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<build_array>:
push   %rax
mov    $0x4,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1142 <build_array+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"**** Problems: It was not possible to create dynamic array \0A\00"
define i32* @build_array(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32*, i32** %3
ret i32* %9
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [60 x i8] c"**** Problems: It was not possible to create dynamic array \00"
define i32* @build_array(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
ret i32* %5
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
}
unsigned long cp_hash_addr(void *addr) { return (unsigned long)addr; }


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

x86 assembly (clang, -O2):
<cp_hash_addr>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cp_hash_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cp_hash_addr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_swap(int *, int *);
int *the_litlest(int *, int, int);
void my_sort_int_tab(int *tab, int size) {
  int loop;
  int *v2;
  loop = 0;
  while (loop < size) {
    v2 = the_litlest(tab, size, loop);
    my_swap(&tab[loop], v2);
    ++loop;
  }
}


x86 assembly (clang, -O0):
<my_sort_int_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <my_sort_int_tab+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <the_litlest@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <my_swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <my_sort_int_tab+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sort_int_tab>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1165 <my_sort_int_tab+0x45>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
mov    %rdi,%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
call   1030 <the_litlest@plt>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <my_swap@plt>
add    $0x1,%rbx
add    $0x4,%r12
cmp    %rbx,%r15
jne    1140 <my_sort_int_tab+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @my_sort_int_tab(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = trunc i64 %7 to i32
%9 = tail call i32* @the_litlest(i32* %0, i32 %1, i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = tail call i32 @my_swap(i32* %10, i32* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char *args[3];
  printf("Going to execute 'ls /'\n");
  args[0] = "ls";
  args[1] = "/";
  args[2] = NULL;
  execvp("ls", args);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rdi,(%rsp)
lea    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Going to execute 'ls /'\0A\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [2 x i8] c"/\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
store i8* null, i8** %5
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%7 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [2 x i8] c"/\00"
@str = [24 x i8] c"Going to execute 'ls /'\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
store i8* null, i8** %6
%7 = call i32 @execvp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
ret i32 0
}
void gtk_text_iter_get_pixbuf() {}


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

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

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

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