xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void capture_arr(int length, int *arr) {
  for (int i = 0; i < length; i++) {
    scanf("%d", &arr[i]);
  }
}


x86 assembly (clang, -O0):
<capture_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <capture_arr+0x4b>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb8(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <capture_arr+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_arr>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <capture_arr+0x35>
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <capture_arr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @capture_arr(i32 %0, i32* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\n", (a - b) ^ 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
xor    $0x1,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
sub    (%rsp),%esi
xor    $0x1,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = xor i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, float *, int);
void write_real_(float *z, int *fd) { write(*fd, z, sizeof(float)); }


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

x86 assembly (clang, -O2):
<write_real_>:
mov    %rdi,%rax
mov    (%rsi),%edi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_real_(float* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @write(i32 %3, float* %0, i32 4)
ret void
}
/* Variables and functions */
int *malloc(int);
int main(int argc, char **argv) {
  int g_init_a = 1;
  int g_uninit;
  static int s_g_init_a = 1;
  static int s_g_uninit;
  const int const_a = 1;
  int *malloc_p_a;
  malloc_p_a = malloc(sizeof(int));
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
jmp    1142 <main+0x32>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@main.s_g_init_a = internal global i32 1
@main.s_g_uninit = internal global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %8
%10 = call i32* @malloc(i32 4)
store i32* %10, i32** %9
br label %11
11: ; preds = %2, %11
br label %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
br label %4
4: ; preds = %4, %2
br label %4
}
void AONIOC32kHzOutputEnable(void) {
  (*((volatile unsigned long *)(0x40094000 + 0x00000010))) = 0x0;
}


x86 assembly (clang, -O0):
<AONIOC32kHzOutputEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40094010,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONIOC32kHzOutputEnable>:
movq   $0x0,0x40094010
ret

LLVM IR (-O0):
define void @AONIOC32kHzOutputEnable() {
store volatile i64 0, i64* inttoptr (i64 1074348048 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONIOC32kHzOutputEnable() {
store volatile i64 0, i64* inttoptr (i64 1074348048 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ GetCurrentThread();
pthread_t pthread_self(void) { return GetCurrentThread(); }


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

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

LLVM IR (-O0):
define i32 @pthread_self() {
%1 = call i32 (...) @GetCurrentThread()
ret i32 %1
}

LLVM IR (-O2):
define i32 @pthread_self() {
%1 = tail call i32 (...) @GetCurrentThread()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char hexchar(unsigned int val) {
  if (val < 10)
    return '0' + val;
  if (val < 16)
    return 'a' + val - 10;
  abort();
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    1133 <hexchar+0x23>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1155 <hexchar+0x45>
cmpl   $0x10,-0x8(%rbp)
jae    114e <hexchar+0x3e>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1155 <hexchar+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
mov    $0x30,%al
cmp    $0xa,%edi
jb     111e <hexchar+0xe>
mov    $0x57,%al
cmp    $0x10,%edi
jae    1124 <hexchar+0x14>
add    %al,%dil
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define signext i8 @hexchar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %20
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ult i32 %11, 16
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add i32 97, %14
%16 = sub i32 %15, 10
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %20
18: ; preds = %10
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %13, %6
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @hexchar(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 16
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %3, %1
%8 = phi i8 [ 48, %1 ], [ 87, %3 ]
%9 = trunc i32 %0 to i8
%10 = add nuw nsw i8 %8, %9
ret i8 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, int, size_t, int /*<<< orphan*/ *);
size_t serd_file_sink(const void *buf, size_t len, void *stream) {
  return fwrite(buf, 1, len, (FILE *)stream);
}


x86 assembly (clang, -O0):
<serd_file_sink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serd_file_sink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define i64 @serd_file_sink(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i64 @fwrite(i8* %0, i32 1, i64 %1, i32* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler_pere(int sig) { printf("Signal recu SIGUSR2\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Signal recu SIGUSR2\0A\00"
define void @handler_pere(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Signal recu SIGUSR2\00"
define void @handler_pere(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int utime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (int)tv.tv_sec * 1000000 + (int)tv.tv_usec;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @utime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @utime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ CompileCondition();
int /*<<< orphan*/ ResetIf();
int /*<<< orphan*/ WriteInstruction(char *);
void CR_CanGoRight(void) {
  WriteInstruction("call cangr");
  WriteInstruction("jp nz,      ");
  CompileCondition();
  ResetIf();
}


x86 assembly (clang, -O0):
<CR_CanGoRight>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec4(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <CompileCondition@plt>
mov    $0x0,%al
call   1030 <ResetIf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_CanGoRight>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <WriteInstruction@plt>
lea    0xec7(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <CompileCondition@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ResetIf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"call cangr\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoRight() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @CompileCondition()
%4 = call i32 (...) @ResetIf()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call cangr\00"
@.str.1 = [13 x i8] c"jp nz, \00"
define void @CR_CanGoRight() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @CompileCondition()
%4 = tail call i32 (...) @ResetIf()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int write(int, char const *, int /*<<< orphan*/);
int __write1(const char *s) { return write(1, s, strlen(s)); }


x86 assembly (clang, -O0):
<__write1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__write1>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @__write1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__write1(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 %3
}
int check_comment(char *s) {
  while (*s && (*s == ' ' || *s == '\t' || *s == '\n'))
    ++s;
  return *s == ';';
}


x86 assembly (clang, -O0):
<check_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115d <check_comment+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1157 <check_comment+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0xa(%rbp)
je     1157 <check_comment+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    116d <check_comment+0x6d>
jmp    117e <check_comment+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <check_comment+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_comment>:
movabs $0x100000600,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    $0x20,%rcx
ja     1125 <check_comment+0x25>
bt     %rcx,%rax
jae    1125 <check_comment+0x25>
add    $0x1,%rdi
jmp    1110 <check_comment+0x10>
xor    %eax,%eax
cmp    $0x3b,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_comment(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 10, label %5
i8 32, label %5
i8 9, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
%8 = icmp eq i8 %4, 59
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void zero_dvector(double *v, int n) { memset(v, 0, sizeof(double) * n); }


x86 assembly (clang, -O0):
<zero_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_dvector>:
lea    0x0(,%rsi,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_dvector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 8, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(double* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @zero_dvector(double* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i32 @memset(double* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nodemask_t;

/* Variables and functions */
void nodemask_set(nodemask_t *mask, int node) { return; }


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

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

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

LLVM IR (-O2):
define void @nodemask_set(i32* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_int8_t(int /*<<< orphan*/ *, int);
int8_t atomic_postdec_int8_t(int8_t *var) {
  return atomic_postsub_int8_t(var, 1);
}


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

x86 assembly (clang, -O2):
<atomic_postdec_int8_t>:
mov    $0x1,%esi
jmp    1030 <atomic_postsub_int8_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_postdec_int8_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_int8_t(i32* %0, i32 1)
ret i32 %2
}
int ft_isalpha(int c) {
  if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <ft_isalpha+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    112f <ft_isalpha+0x2f>
cmpl   $0x61,-0x8(%rbp)
jl     113b <ft_isalpha+0x3b>
cmpl   $0x7a,-0x8(%rbp)
jg     113b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %15, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 97
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 122
br i1 %14, label %15, label %16
15: ; preds = %12, %6
store i32 1, i32* %2
br label %17
16: ; preds = %12, %9
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int main() {
  func1();
  func2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 (...) @func2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort_gzip();
void read_error(void) {
  {
    abort_gzip();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @read_error() {
%1 = tail call i32 (...) @abort_gzip()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mainloop_free() {
  printf("NOT IMPLEMENTED:"
         "pa_mainloop_free"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_mainloop_free\0A\00"
define i32 @pa_mainloop_free() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_mainloop_free\00"
define i32 @pa_mainloop_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double floor(double);
int foo(double d) { return floor(d) != 0.0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <floor@plt>
xorpd  %xmm1,%xmm1
cmpneqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.floor.f64(double %3)
%5 = fcmp une double %4, 0.000000e+00
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp une double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *stdc_04A183FC(char *, char const *);
char *strcpy(char *dest, const char *src) { return stdc_04A183FC(dest, src); }


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

x86 assembly (clang, -O2):
<strcpy>:
jmp    1030 <stdc_04A183FC@plt>

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

LLVM IR (-O2):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = tail call i8* @stdc_04A183FC(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DAY_7;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_day_7() { return nl_langinfo(DAY_7); }


x86 assembly (clang, -O0):
<langinfo_day_7>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_day_7>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@DAY_7 = global i32 0
define i8* @langinfo_day_7() {
%1 = load i32, i32* @DAY_7
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@DAY_7 = global i32 0
define i8* @langinfo_day_7() {
%1 = load i32, i32* @DAY_7
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void res(int i) {
  if (i <= 0) {
    printf("%d ", i);
    return;
  }
  printf("%d ", i);
  res(i - 5);
  printf("%d ", i);
}


x86 assembly (clang, -O0):
<res>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1149 <res+0x29>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1172 <res+0x52>
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
call   1040 <res@plt>
mov    -0x4(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<res>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    114c <res+0x2c>
lea    -0x5(%rbx),%edi
call   1040 <res@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @res(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br i1 %2, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = add nsw i32 %0, -5
tail call void @res(i32 %6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %4
}
int DPRINTF(const char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DPRINTF(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_load_module() {
  printf("NOT IMPLEMENTED:"
         "pa_context_load_module"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_context_load_module\0A\00"
define i32 @pa_context_load_module() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_context_load_module\00"
define i32 @pa_context_load_module() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
void strcpy(char a[], char b[]) {
  for (int i = 0; i < strlen(a); i++) {
    b[i] = a[i];
  }
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1167 <strcpy+0x57>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <strcpy+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    114c <strcpy+0x3c>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <strcpy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strcpy(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %5
}
unsigned char fun() { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @fun() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @fun() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_strings(char *p[], int n) {
  int count;
  for (count = 0; count < n; count++)
    printf("%s\n", p[count]);
}


x86 assembly (clang, -O0):
<print_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print_strings+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_strings+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_strings+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_strings+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_strings(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fred(int arg) { printf("fred: luliusheng test %d\n", arg); }


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

x86 assembly (clang, -O2):
<fred>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"fred: luliusheng test %d\0A\00"
define void @fred(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"fred: luliusheng test %d\0A\00"
define void @fred(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int setpgrp();
int main(void) { return setpgrp(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setpgrp()
ret i32 %1
}
/* Variables and functions */
char *strrchr(char *, char);
char *__basename(char *path) {
  char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<__basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <__basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <__basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @__basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void libMU_Retardo(unsigned long repeticiones) {
  extern void SysCtlDelay(unsigned long);
  SysCtlDelay(repeticiones);
}


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

x86 assembly (clang, -O2):
<libMU_Retardo>:
jmp    1030 <SysCtlDelay@plt>

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

LLVM IR (-O2):
define void @libMU_Retardo(i64 %0) {
tail call void @SysCtlDelay(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G92_f(char *s) {
  debug("G92_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G92_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G92_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G92_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G92_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G92_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G92_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
void uninitvar_ftell(void) {
  FILE *stream;
  (void)ftell(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_ftell>:
jmp    1030 <ftell@plt>

LLVM IR (-O0):
define void @uninitvar_ftell() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @ftell(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ftell() {
%1 = tail call i32 @ftell(i32* undef)
ret void
}
/* Variables and functions */
int PTHREAD_MUTEX_ERRORCHECK;
int pthread_get_mutex_errorcheck_type() { return PTHREAD_MUTEX_ERRORCHECK; }


x86 assembly (clang, -O0):
<pthread_get_mutex_errorcheck_type>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_get_mutex_errorcheck_type>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@PTHREAD_MUTEX_ERRORCHECK = global i32 0
define i32 @pthread_get_mutex_errorcheck_type() {
%1 = load i32, i32* @PTHREAD_MUTEX_ERRORCHECK
ret i32 %1
}

LLVM IR (-O2):
@PTHREAD_MUTEX_ERRORCHECK = global i32 0
define i32 @pthread_get_mutex_errorcheck_type() {
%1 = load i32, i32* @PTHREAD_MUTEX_ERRORCHECK
ret i32 %1
}
int bcd2int(int bcd, int w) {
  int v = 0, m = 1, i;
  for (i = 0; i < (w ? 4 : 2); i++) {
    v += (bcd % 16) * m;
    m *= 10;
    bcd /= 16;
  }
  return v;
}


x86 assembly (clang, -O0):
<bcd2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%esi
mov    $0x2,%ecx
mov    $0x4,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jge    1177 <bcd2int+0x77>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0xa,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <bcd2int+0x1f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd2int>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
lea    (%rax,%rax,1),%r8d
add    $0x2,%r8d
xor    %eax,%eax
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
lea    0xf(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
lea    0xff(%rdi),%r9d
cmovns %edi,%r9d
mov    %ecx,%esi
and    $0xfffffff0,%esi
sub    %esi,%edi
imul   %edx,%edi
add    %eax,%edi
sar    $0x4,%ecx
lea    0xf(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
and    $0xfffffff0,%eax
sub    %eax,%ecx
imul   %edx,%ecx
lea    (%rcx,%rcx,4),%eax
lea    (%rdi,%rax,2),%eax
imul   $0x64,%edx,%edx
sar    $0x8,%r9d
mov    %r9d,%edi
add    $0xfffffffe,%r8d
jne    1120 <bcd2int+0x20>
ret

LLVM IR (-O0):
define i32 @bcd2int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %26, %2
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 4, i32 2
%14 = icmp slt i32 %9, %13
br i1 %14, label %15, label %29
15: ; preds = %8
%16 = load i32, i32* %3
%17 = srem i32 %16, 16
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, 10
store i32 %23, i32* %6
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 16
store i32 %25, i32* %3
br label %26
26: ; preds = %15
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %8
29: ; preds = %8
%30 = load i32, i32* %5
ret i32 %30
}

LLVM IR (-O2):
define i32 @bcd2int(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 2, i32 4
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ 0, %2 ], [ %20, %5 ]
%7 = phi i32 [ 1, %2 ], [ %18, %5 ]
%8 = phi i32 [ 0, %2 ], [ %17, %5 ]
%9 = phi i32 [ %0, %2 ], [ %19, %5 ]
%10 = srem i32 %9, 16
%11 = mul nsw i32 %7, %10
%12 = add nsw i32 %11, %8
%13 = mul nsw i32 %7, 10
%14 = sdiv i32 %9, 16
%15 = srem i32 %14, 16
%16 = mul nsw i32 %13, %15
%17 = add nsw i32 %16, %12
%18 = mul i32 %7, 100
%19 = sdiv i32 %9, 256
%20 = add nuw nsw i32 %6, 2
%21 = icmp eq i32 %20, %4
br i1 %21, label %22, label %5
22: ; preds = %5
ret i32 %17
}
/* Variables and functions */
scalar_t__ check_uid_available(int);
int find_available_uid() {
  int i;
  for (i = 1000; i > 0; i--) {
    if (check_uid_available(i))
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<find_available_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3e8,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1153 <find_available_uid+0x43>
mov    -0x4(%rbp),%edi
call   1030 <check_uid_available@plt>
cmp    $0x0,%rax
je     1140 <find_available_uid+0x30>
jmp    1153 <find_available_uid+0x43>
jmp    1145 <find_available_uid+0x35>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <find_available_uid+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_available_uid>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3e9,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%ebp
mov    %ebp,%edi
call   1030 <check_uid_available@plt>
test   %rax,%rax
jne    1139 <find_available_uid+0x29>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <find_available_uid+0x10>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @find_available_uid() {
br label %1
1: ; preds = %0, %5
%2 = phi i32 [ 1000, %0 ], [ %6, %5 ]
%3 = tail call i64 @check_uid_available(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = add nsw i32 %2, -1
%7 = icmp ugt i32 %2, 1
br i1 %7, label %1, label %8
8: ; preds = %1, %5
%9 = phi i32 [ %2, %1 ], [ 0, %5 ]
ret i32 %9
}