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

/* Variables and functions */
int /*<<< orphan*/ FBIOPUTCMAP;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_cmap *);
int /*<<< orphan*/ stderr;
void set8map(int fh, struct fb_cmap *map) {
  if (ioctl(fh, FBIOPUTCMAP, map) < 0) {
    fprintf(stderr, "Error putting colormap");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<set8map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    117d <set8map+0x4d>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set8map>:
push   %rax
mov    %rsi,%rdx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
test   %rax,%rax
js     1149 <set8map+0x19>
pop    %rax
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.fb_cmap = type { i32 }
@FBIOPUTCMAP = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Error putting colormap\00"
define void @set8map(i32 %0, %struct.fb_cmap* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_cmap*
store i32 %0, i32* %3
store %struct.fb_cmap* %1, %struct.fb_cmap** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOPUTCMAP
%7 = load %struct.fb_cmap*, %struct.fb_cmap** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_cmap* %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.fb_cmap = type { i32 }
@FBIOPUTCMAP = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"Error putting colormap\00"
define void @set8map(i32 %0, %struct.fb_cmap* %1) {
%3 = load i32, i32* @FBIOPUTCMAP
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_cmap* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_up(char *);
int /*<<< orphan*/ message(char *, int);
void sf_error(void) {
  message("", 1);
  clean_up("sorry, score file is out of order");
}


x86 assembly (clang, -O0):
<sf_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xef6(%rip),%rdi
mov    $0x1,%esi
call   1030 <message@plt>
lea    0xec4(%rip),%rdi
call   1040 <clean_up@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_error>:
push   %rax
lea    0xef9(%rip),%rdi
mov    $0x1,%esi
call   1030 <message@plt>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <clean_up@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"sorry, score file is out of order\00"
define void @sf_error() {
%1 = call i32 @message(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @clean_up(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"sorry, score file is out of order\00"
define void @sf_error() {
%1 = tail call i32 @message(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @clean_up(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void header_flush(t) register struct token *t;
{
  show_arg_names(t);
  put_nl();
  show_arg_types(t);
  tok_free(t);
}


x86 assembly (clang, -O0):
<header_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <show_arg_names@plt>
mov    $0x0,%al
call   1030 <put_nl@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <show_arg_types@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <tok_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_flush>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <show_arg_names@plt>
xor    %eax,%eax
call   1030 <put_nl@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <show_arg_types@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1050 <tok_free@plt>

LLVM IR (-O0):
%struct.token = type opaque
define void @header_flush(%struct.token* %0) {
%2 = alloca %struct.token*
store %struct.token* %0, %struct.token** %2
%3 = load %struct.token*, %struct.token** %2
%4 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_arg_names to i32 (%struct.token*, ...)*)(%struct.token* %3)
%5 = call i32 (...) @put_nl()
%6 = load %struct.token*, %struct.token** %2
%7 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_arg_types to i32 (%struct.token*, ...)*)(%struct.token* %6)
%8 = load %struct.token*, %struct.token** %2
%9 = call i32 (%struct.token*, ...) bitcast (i32 (...)* @tok_free to i32 (%struct.token*, ...)*)(%struct.token* %8)
ret void
}

LLVM IR (-O2):
%struct.token = type opaque
define void @header_flush(%struct.token* %0) {
%2 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_arg_names to i32 (%struct.token*, ...)*)(%struct.token* %0)
%3 = tail call i32 (...) @put_nl()
%4 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @show_arg_types to i32 (%struct.token*, ...)*)(%struct.token* %0)
%5 = tail call i32 (%struct.token*, ...) bitcast (i32 (...)* @tok_free to i32 (%struct.token*, ...)*)(%struct.token* %0)
ret void
}
char hexdigitz(int x) {
  if (x < 10)
    return 48 + x;
  else
    return x + 87;
}


x86 assembly (clang, -O0):
<hexdigitz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <hexdigitz+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1128 <hexdigitz+0x28>
mov    -0x8(%rbp),%eax
add    $0x57,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigitz>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hexdigitz(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 87
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @hexdigitz(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
void cdfCloseFile(int fileID) {}


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

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

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

LLVM IR (-O2):
define void @cdfCloseFile(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool sancus_get_u8l(long v, uint8_t *out) {
  if ((v >= 0) && (v <= 0xff)) {
    if (out != NULL)
      *out = (uint8_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u8l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1147 <sancus_get_u8l+0x47>
cmpq   $0xff,-0x10(%rbp)
jg     1147 <sancus_get_u8l+0x47>
cmpq   $0x0,-0x18(%rbp)
je     113b <sancus_get_u8l+0x3b>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114e <sancus_get_u8l+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u8l>:
xor    %eax,%eax
cmp    $0xff,%rdi
ja     1118 <sancus_get_u8l+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u8l+0x18>
mov    %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @sancus_get_u8l(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 256
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ triangles_in_the_term(int, int);
int main(void) {
  triangles_in_the_term(7, 2);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @triangles_in_the_term(i32 7, i32 2)
ret i32 0
}
/* Variables and functions */
char *n_strdup(char const *);
char *xstrdup(const char *s) { return n_strdup(s); }


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

x86 assembly (clang, -O2):
<xstrdup>:
jmp    1030 <n_strdup@plt>

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i8* @n_strdup(i8* %0)
ret i8* %2
}
void sk_set_cmp_func(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_set_cmp_func() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/);
void tty_debug(void *ui, const char *fmt, va_list va) {
  FILE *tty = ui;
  vfprintf(tty, fmt, va);
}


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

x86 assembly (clang, -O2):
<tty_debug>:
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
define void @tty_debug(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i32*, i32** %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @vfprintf(i32* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @tty_debug(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @vfprintf(i32* %4, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void guessNumber(int guess) {
  if (guess == 555) {
    printf("Correct. You guessed it!\n");
  }
  if (guess < 555) {
    printf("Your guess is too low.\n");
  }
  if (guess > 555) {
    printf("Your guess is too high.\n");
  }
}


x86 assembly (clang, -O0):
<guessNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x22b,-0x4(%rbp)
jne    1134 <guessNumber+0x24>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x22b,-0x4(%rbp)
jge    114d <guessNumber+0x3d>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x22b,-0x4(%rbp)
jle    1166 <guessNumber+0x56>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guessNumber>:
cmp    $0x22b,%edi
lea    0xefb(%rip),%rax
lea    0xedc(%rip),%rcx
cmovl  %rax,%rcx
lea    0xf00(%rip),%rdi
cmovne %rcx,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Correct. You guessed it!\0A\00"
@.str.1 = [24 x i8] c"Your guess is too low.\0A\00"
@.str.2 = [25 x i8] c"Your guess is too high.\0A\00"
define void @guessNumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 555
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 555
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 555
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Your guess is too high.\00"
@str.3 = [23 x i8] c"Your guess is too low.\00"
@str.4 = [25 x i8] c"Correct. You guessed it!\00"
define void @guessNumber(i32 %0) {
%2 = icmp eq i32 %0, 555
%3 = icmp slt i32 %0, 555
%4 = select i1 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0), i8* %4
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_swap(int *, int *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int a;
  int b;
  a = 1;
  b = 2;
  ft_swap(&a, &b);
  if (a == 2 && b == 1)
    printf("CORRECT\n");
  else
    printf("FAKE AND GAY\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <ft_swap@plt>
cmpl   $0x2,-0x8(%rbp)
jne    116f <main+0x4f>
cmpl   $0x1,-0xc(%rbp)
jne    116f <main+0x4f>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x5b>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0x2,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <ft_swap@plt>
mov    0x4(%rsp),%eax
xor    $0x2,%eax
mov    (%rsp),%ecx
xor    $0x1,%ecx
lea    0xebc(%rip),%rdx
lea    0xea8(%rip),%rdi
or     %eax,%ecx
cmove  %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"CORRECT\0A\00"
@.str.1 = [14 x i8] c"FAKE AND GAY\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = call i32 @ft_swap(i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %7, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"FAKE AND GAY\00"
@str.2 = [8 x i8] c"CORRECT\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %1
store i32 2, i32* %2
%5 = call i32 @ft_swap(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 2
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
%10 = select i1 %7, i1 %9, i1 false
%11 = select i1 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int32_t print_usage() {
  return fprintf(stderr, "Usage: elfconvert <exename>\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: elfconvert <exename>\0A\00"
define i32 @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Usage: elfconvert <exename>\0A\00"
define i32 @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void bc_log_close() {}


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

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

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

LLVM IR (-O2):
define void @bc_log_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ motor(int, int);
void turgau() {
  motor(0, 0);
  motor(1, 70);
}


x86 assembly (clang, -O0):
<turgau>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x46,%esi
call   1030 <motor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<turgau>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <motor@plt>
mov    $0x1,%edi
mov    $0x46,%esi
pop    %rax
jmp    1030 <motor@plt>

LLVM IR (-O0):
define void @turgau() {
%1 = call i32 @motor(i32 0, i32 0)
%2 = call i32 @motor(i32 1, i32 70)
ret void
}

LLVM IR (-O2):
define void @turgau() {
%1 = tail call i32 @motor(i32 0, i32 0)
%2 = tail call i32 @motor(i32 1, i32 70)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ block_comm();
int /*<<< orphan*/ block_draw();
void c_block() {
  block_comm();
  block_draw();
}


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

x86 assembly (clang, -O2):
<c_block>:
push   %rax
xor    %eax,%eax
call   1040 <block_comm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <block_draw@plt>

LLVM IR (-O0):
define void @c_block() {
%1 = call i32 (...) @block_comm()
%2 = call i32 (...) @block_draw()
ret void
}

LLVM IR (-O2):
define void @c_block() {
%1 = tail call i32 (...) @block_comm()
%2 = tail call i32 (...) @block_draw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_draw_area();
void init_x11() { get_draw_area(); }


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

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

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

LLVM IR (-O2):
define void @init_x11() {
%1 = tail call i32 (...) @get_draw_area()
ret void
}
int x26_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x26_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ skipblk(int /*<<< orphan*/);
int print(char *fname, ssize_t l, char b[512]) {
  puts(fname);
  skipblk(l);
  return 0;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%edi
call   1040 <skipblk@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %esi,%ebx
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <skipblk@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @print(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = tail call i32 @skipblk(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  unsigned long long l = 0x40000000000ULL;
  int n;
  for (n = 0; n < 8; n++)
    if (l / (0x200000000ULL << n) != (0x200 >> n))
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x40000000000,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    118c <main+0x7c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movabs $0x200000000,%rdx
shl    %cl,%rdx
mov    %rdx,%rcx
xor    %edx,%edx
div    %rcx
mov    -0x14(%rbp),%ecx
mov    $0x200,%edx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
je     1179 <main+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    117e <main+0x6e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 4398046511104, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = shl i64 8589934592, %10
%12 = udiv i64 %8, %11
%13 = load i32, i32* %3
%14 = ashr i32 512, %13
%15 = sext i32 %14 to i64
%16 = icmp ne i64 %12, %15
br i1 %16, label %17, label %19
17: ; preds = %7
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void char_range(void) {
  unsigned char max = -1;
  signed char min = (max - 1) / 2 + 1;
  printf("\tchar:\n");
  printf("\t\tSigned minimum = %d\n", min);
  printf("\t\tUnsigned maximum = %u\n", max);
}


x86 assembly (clang, -O0):
<char_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %al,-0x2(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x2(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_range>:
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0xffffff80,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0xff,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\09char:\0A\00"
@.str.1 = [23 x i8] c"\09\09Signed minimum = %d\0A\00"
@.str.2 = [25 x i8] c"\09\09Unsigned maximum = %u\0A\00"
define void @char_range() {
%1 = alloca i8
%2 = alloca i8
store i8 -1, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = sub nsw i32 %4, 1
%6 = sdiv i32 %5, 2
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8, i8* %1
%14 = zext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"\09\09Signed minimum = %d\0A\00"
@.str.2 = [25 x i8] c"\09\09Unsigned maximum = %u\0A\00"
@str = [7 x i8] c"\09char:\00"
define void @char_range() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 -128)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 255)
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *LoadSymbol(void *handle, const char *symbol) {
  return dlsym(handle, symbol);
}


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

x86 assembly (clang, -O2):
<LoadSymbol>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @LoadSymbol(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
_Bool checkIfPressed(char *buff) { return strcmp("0", buff) == 0; }


x86 assembly (clang, -O0):
<checkIfPressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIfPressed>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define zeroext i1 @checkIfPressed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i32 %4, 0
ret i1 %5
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define zeroext i1 @checkIfPressed(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %0)
%3 = icmp eq i32 %2, 0
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ r();
void q() {
  printf("hello");
  r();
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @q() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @r()
ret void
}
void readConfigFromEE() {}


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

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

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

LLVM IR (-O2):
define void @readConfigFromEE() {
ret void
}
int min(int misc, int other) { return (misc < other) ? misc : other; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ raiseerr(int);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int send_repl(int send_sock, char *msg) {
  if (send(send_sock, msg, strlen(msg), 0) < 0) {
    raiseerr(4);
    close(send_sock);
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<send_repl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
cmp    $0x0,%rax
jge    11a9 <send_repl+0x59>
mov    $0x4,%edi
call   1030 <raiseerr@plt>
mov    -0x4(%rbp),%edi
call   1060 <close@plt>
xor    %edi,%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_repl>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1050 <send@plt>
test   %rax,%rax
js     117c <send_repl+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x4,%edi
call   1030 <raiseerr@plt>
mov    %ebp,%edi
call   1060 <close@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @send_repl(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @send(i32 %5, i8* %6, i32 %8, i32 0)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = call i32 @raiseerr(i32 4)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
%15 = call i32 @exit(i32 0)
unreachable
16: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @send_repl(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @raiseerr(i32 4)
%8 = tail call i32 @close(i32 %0)
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
ret i32 0
}
int ft_strcmp(char *s1, char *s2) {
  while (*s1 == *s2 && *s1) {
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <ft_strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <ft_strcmp+0x47>
jmp    1164 <ft_strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <ft_strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <ft_strcmp+0x34>
cmp    %cl,%al
jne    1134 <ft_strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <ft_strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <ft_strcmp+0x20>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ft_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = sext i8 %19 to i32
%22 = sext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
int line_count(char *data) {
  unsigned int i = 0;
  while (*data != '\0') {
    if (*data == '\n')
      i++;
    data++;
  }
  return i;
}


x86 assembly (clang, -O0):
<line_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <line_count+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <line_count+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <line_count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_count>:
xor    %eax,%eax
jmp    1117 <line_count+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xa,%cl
je     1110 <line_count+0x10>
test   %cl,%cl
jne    1113 <line_count+0x13>
ret

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

LLVM IR (-O2):
define i32 @line_count(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 10, label %6
]
6: ; preds = %2
%7 = add i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i32 %4
}
int utcstr_2_doy(char *utc) {
  int D[3];
  int i, doy;
  for (i = 0; i < 3; i++) {
    D[i] = utc[i + 5] - '0';
  }
  doy = D[0] * 100 + D[1] * 10 + D[2];
  return doy;
}


x86 assembly (clang, -O0):
<utcstr_2_doy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1143 <utcstr_2_doy+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
sub    $0x30,%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    110f <utcstr_2_doy+0xf>
imul   $0x64,-0x14(%rbp),%eax
imul   $0xa,-0x10(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utcstr_2_doy>:
movsbl 0x5(%rdi),%eax
movsbl 0x6(%rdi),%ecx
movsbl 0x7(%rdi),%edx
imul   $0x64,%eax,%eax
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
add    %edx,%eax
add    $0xffffeb30,%eax
ret

LLVM IR (-O0):
define i32 @utcstr_2_doy(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i32]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 48
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%26 = load i32, i32* %25
%27 = mul nsw i32 %26, 100
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%29 = load i32, i32* %28
%30 = mul nsw i32 %29, 10
%31 = add nsw i32 %27, %30
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%33 = load i32, i32* %32
%34 = add nsw i32 %31, %33
store i32 %34, i32* %5
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @utcstr_2_doy(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 6
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = mul nsw i32 %4, 100
%12 = mul nsw i32 %7, 10
%13 = add nsw i32 %12, %11
%14 = add nsw i32 %13, %10
%15 = add nsw i32 %14, -5328
ret i32 %15
}
int configfile_parsecmdoverride(int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<configfile_parsecmdoverride>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @configfile_parsecmdoverride(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int get_bit(int number, int position) {
  return (number & (1 << position)) != 0;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_bit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x47() {
  Assert_real((isxdigit(71) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              360, ("isxdigit should be 0 for G"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x168,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x47>:
push   %rax
mov    $0x47,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x168,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for G\00"
define void @t_isxdigit_0x47() {
%1 = call i64 @isxdigit(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for G\00"
define void @t_isxdigit_0x47() {
%1 = tail call i64 @isxdigit(i32 71)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is a test to push my local project to smc");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"This is a test to push my local project to smc\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"This is a test to push my local project to smc\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double pow(double, int);
scalar_t__ random();
double get_rand_random(long *inpl) {
  return (((double)random()) / pow(2.0, 31));
}


x86 assembly (clang, -O0):
<get_rand_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebb(%rip),%xmm0
mov    $0x1f,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_random>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xec6(%rip),%xmm0
mov    $0x1f,%edi
call   1040 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @get_rand_random(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @random()
%4 = sitofp i64 %3 to double
%5 = call double @pow(double 2.000000e+00, i32 31)
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @get_rand_random(i64* nocapture readnone %0) {
%2 = tail call i64 (...) @random()
%3 = sitofp i64 %2 to double
%4 = tail call double @pow(double 2.000000e+00, i32 31)
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ getPymentMethod();
int /*<<< orphan*/ printf(char *);
void entry_to() {
  printf("Factory status: PROCESSING\n");
  getPymentMethod();
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Factory status: PROCESSING\0A\00"
define void @entry_to() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getPymentMethod()
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Factory status: PROCESSING\00"
define void @entry_to() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getPymentMethod()
ret void
}