xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void img_free_pixels(void *pix) { free(pix); }


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

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

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

LLVM IR (-O2):
define void @img_free_pixels(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void lockdep_on(void) {}


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

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

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

LLVM IR (-O2):
define void @lockdep_on() {
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double microtime() {
  int tv_sec, tv_usec;
  double time;
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return tv.tv_sec + tv.tv_usec / 1000000.00;
}


x86 assembly (clang, -O0):
<microtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @microtime() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca %struct.timeval
%5 = alloca %struct.timezone
%6 = call i32 @gettimeofday(%struct.timeval* %4, %struct.timezone* %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %8, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @microtime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %7, %10
ret double %11
}
int console_is_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @console_is_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xaf() {
  Assert_real((isbdigit(175) == 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_isbdigit.c",
              880, ("isbdigit should be 0 for 0xaf"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xaf>:
push   %rax
mov    $0xaf,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x370,%edx
pop    %rax
jmp    1030 <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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xaf\00"
define void @t_isbdigit_0xaf() {
%1 = call i64 @isbdigit(i32 175)
%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 880, i8* getelementptr inbounds ([30 x i8], [30 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xaf\00"
define void @t_isbdigit_0xaf() {
%1 = tail call i64 @isbdigit(i32 175)
%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 880, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar(int);
int baz(int);
int foo(int);
int main(int a) {
  int x = foo(a);
  int y = bar(a);
  int z = baz(a);
  return x + z;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <bar@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <baz@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1050 <foo@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <bar@plt>
mov    %ebx,%edi
call   1030 <baz@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @foo(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @bar(i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = call i32 @baz(i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
%3 = tail call i32 @bar(i32 %0)
%4 = tail call i32 @baz(i32 %0)
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void boolean_to_c(int b) { printf("%d\n", b); }


x86 assembly (clang, -O0):
<boolean_to_c>:
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):
<boolean_to_c>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @boolean_to_c(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void fortune_cookie(char msg[]) { printf("Message reads: %s\n", msg); }


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

x86 assembly (clang, -O2):
<fortune_cookie>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Message reads: %s\0A\00"
define void @fortune_cookie(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int const, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *strchr(char *, char);
int lire(char *chaine, const int longueur) {
  char *positionEntree = NULL;
  if (fgets(chaine, longueur, stdin) != NULL) {
    positionEntree = strchr(chaine, '\n');
    if (positionEntree != NULL) {
      *positionEntree = '\0';
    }
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<lire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1186 <lire+0x66>
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117a <lire+0x5a>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    118d <lire+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lire>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
test   %rax,%rax
je     1156 <lire+0x36>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1154 <lire+0x34>
movb   $0x0,(%rcx)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @lire(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* null, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* @stdin
%10 = call i32* @fgets(i8* %7, i32 %8, i32 %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i8* @strchr(i8* %13, i8 signext 10)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i8*, i8** %6
store i8 0, i8* %18
br label %19
19: ; preds = %17, %12
store i32 1, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @lire(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6
store i8 0, i8* %7
br label %10
10: ; preds = %2, %6, %9
%11 = phi i32 [ 1, %9 ], [ 1, %6 ], [ 0, %2 ]
ret i32 %11
}
int main() {
  register int a;
  a = 4;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void AT_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @AT_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void VP8LDspInitNEON(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8LDspInitNEON() {
ret void
}
/* Type definitions */
struct a_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, struct a_t *);
void do_print_pointer(struct a_t *p) { printf("p = %p", p); }


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

x86 assembly (clang, -O2):
<do_print_pointer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.a_t = type { i32 }
@.str = [7 x i8] c"p = %p\00"
define void @do_print_pointer(%struct.a_t* %0) {
%2 = alloca %struct.a_t*
store %struct.a_t* %0, %struct.a_t** %2
%3 = load %struct.a_t*, %struct.a_t** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.a_t* %3)
ret void
}

LLVM IR (-O2):
%struct.a_t = type { i32 }
@.str = [7 x i8] c"p = %p\00"
define void @do_print_pointer(%struct.a_t* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %struct.a_t* %0)
ret void
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int mkstemp(char *);
int set_cloexec_or_close(int);
int umask(int);
int /*<<< orphan*/ unlink(char *);
int create_tmpfile_cloexec(char *tmpname) {
  int fd;
  mode_t prev_umask = umask(0066);
  fd = mkstemp(tmpname);
  if (fd >= 0) {
    fd = set_cloexec_or_close(fd);
    unlink(tmpname);
  }
  umask(prev_umask);
  return fd;
}


x86 assembly (clang, -O0):
<create_tmpfile_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x36,%edi
call   1040 <umask@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <mkstemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1183 <create_tmpfile_cloexec+0x43>
mov    -0xc(%rbp),%edi
call   1060 <set_cloexec_or_close@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%edi
call   1040 <umask@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tmpfile_cloexec>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x36,%edi
call   1040 <umask@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1050 <mkstemp@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1173 <create_tmpfile_cloexec+0x33>
mov    %ebp,%edi
call   1060 <set_cloexec_or_close@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %r14d,%edi
call   1040 <umask@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 @umask(i32 54)
store i32 %5, i32* %4
%6 = load i8*, i8** %2
%7 = call i32 @mkstemp(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @set_cloexec_or_close(i32 %11)
store i32 %12, i32* %3
%13 = load i8*, i8** %2
%14 = call i32 @unlink(i8* %13)
br label %15
15: ; preds = %10, %1
%16 = load i32, i32* %4
%17 = call i32 @umask(i32 %16)
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = tail call i32 @umask(i32 54)
%3 = tail call i32 @mkstemp(i8* %0)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @set_cloexec_or_close(i32 %3)
%7 = tail call i32 @unlink(i8* %0)
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ %6, %5 ], [ %3, %1 ]
%10 = tail call i32 @umask(i32 %2)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ coefficient;

/* Variables and functions */
int honor(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int coefficient[] = {0, 1, 1};
  int size = ((int)sizeof(coefficient) / sizeof(int));
  printf("The result of f(%d) is %2d\n", 2,
         honor(coefficient, coefficient + size - 1, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
mov    $0x2,%edx
call   1040 <honor@plt>
mov    %eax,%edx
lea    0xe98(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdi
mov    $0x2,%edx
call   1040 <honor@plt>
lea    0xeb7(%rip),%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.coefficient = [3 x i32] [i32 0, i32 1, i32 1]
@.str = [28 x i8] c"The result of f(%d) is %2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
store i32 3, i32* %3
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = call i32 @honor(i32* %5, i32* %10, i32 2)
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 2, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.coefficient = [3 x i32] [i32 0, i32 1, i32 1]
@.str = [28 x i8] c"The result of f(%d) is %2d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%5 = call i32 @honor(i32* %3, i32* %4, i32 2)
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 2, i32 %5)
ret i32 0
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("sizeof sockaddr=%d\n", sizeof(struct sockaddr));
  printf("sizeof sockaddr_in=%d\n", sizeof(struct sockaddr_in));
  printf("sizeof sockaddr_in6=%d\n", sizeof(struct sockaddr_in6));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"sizeof sockaddr=%d\0A\00"
@.str.1 = [23 x i8] c"sizeof sockaddr_in=%d\0A\00"
@.str.2 = [24 x i8] c"sizeof sockaddr_in6=%d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"sizeof sockaddr=%d\0A\00"
@.str.1 = [23 x i8] c"sizeof sockaddr_in=%d\0A\00"
@.str.2 = [24 x i8] c"sizeof sockaddr_in6=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initialize_object();
void _main() { initialize_object(); }


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

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

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

LLVM IR (-O2):
define void @_main() {
%1 = tail call i32 (...) @initialize_object()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void UNLKS7057Reset(void) { Sync(); }


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

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

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

LLVM IR (-O2):
define void @UNLKS7057Reset() {
%1 = tail call i32 (...) @Sync()
ret void
}
/* Variables and functions */
int ascii_byte_to_int(char *);
int bit_create(unsigned int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned int a[] = {0, 1, 1, 0};
  printf("%lX", bit_create(a, 4));
  printf("%X", ascii_byte_to_int("AE"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1050 <bit_create@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <ascii_byte_to_int@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1050 <bit_create@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <ascii_byte_to_int@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 0, i32 1, i32 1, i32 0]
@.str = [4 x i8] c"%lX\00"
@.str.1 = [3 x i8] c"%X\00"
@.str.2 = [3 x i8] c"AE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @bit_create(i32* %4, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @ascii_byte_to_int(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 0, i32 1, i32 1, i32 0]
@.str = [4 x i8] c"%lX\00"
@.str.1 = [3 x i8] c"%X\00"
@.str.2 = [3 x i8] c"AE\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @bit_create(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @ascii_byte_to_int(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ check_ready();
int picosat_enable_trace_generation(void) {
  int res = 0;
  check_ready();
  return res;
}


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

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

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

LLVM IR (-O2):
define i32 @picosat_enable_trace_generation() {
%1 = tail call i32 (...) @check_ready()
ret i32 0
}
int nxtd_usb_connect(struct nxtd_nxt_usb *nxt) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.nxtd_nxt_usb = type opaque
define i32 @nxtd_usb_connect(%struct.nxtd_nxt_usb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DebugLogSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void DebugLogSettingsRequestUpdate() {
  UAVObjRequestUpdate(DebugLogSettingsHandle());
}


x86 assembly (clang, -O0):
<DebugLogSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DebugLogSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DebugLogSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <DebugLogSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @DebugLogSettingsRequestUpdate() {
%1 = call i32 (...) @DebugLogSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @DebugLogSettingsRequestUpdate() {
%1 = tail call i32 (...) @DebugLogSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
double SepPenalty(int ival) {
  switch (ival) {
  case 1:
    return (0.5);
  case 2:
    return (0.2);
  case 3:
    return (0.0);
  }
  return (0);
}


x86 assembly (clang, -O0):
<SepPenalty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <SepPenalty+0x3d>
jmp    111b <SepPenalty+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114f <SepPenalty+0x4f>
jmp    112c <SepPenalty+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     1161 <SepPenalty+0x61>
jmp    116e <SepPenalty+0x6e>
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <SepPenalty+0x76>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <SepPenalty+0x76>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <SepPenalty+0x76>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SepPenalty>:
add    $0xffffffff,%edi
xorps  %xmm0,%xmm0
cmp    $0x2,%edi
ja     111a <SepPenalty+0x1a>
movslq %edi,%rax
lea    0xeeb(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @SepPenalty(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
5: ; preds = %1
store double 5.000000e-01, double* %2
br label %9
6: ; preds = %1
store double 2.000000e-01, double* %2
br label %9
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
8: ; preds = %1
store double 0.000000e+00, double* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
@switch.table.SepPenalty = [3 x double] [double 5.000000e-01, double 2.000000e-01, double 0.000000e+00]
define double @SepPenalty(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x double], [3 x double]* @switch.table.SepPenalty, i64 0, i64 %5
%7 = load double, double* %6
br label %8
8: ; preds = %1, %4
%9 = phi double [ %7, %4 ], [ 0.000000e+00, %1 ]
ret double %9
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ mus_close_file_descriptors(int);
int mus_close(int fd) {
  mus_close_file_descriptors(fd);
  return (close(fd));
}


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

x86 assembly (clang, -O2):
<mus_close>:
push   %rbx
mov    %edi,%ebx
call   1030 <mus_close_file_descriptors@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
define i32 @mus_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @mus_close_file_descriptors(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @mus_close(i32 %0) {
%2 = tail call i32 @mus_close_file_descriptors(i32 %0)
%3 = tail call i32 @close(i32 %0)
ret i32 %3
}
int reverse_mask(int mask) {
  mask = ((mask >> 1) & 0x5555) | ((mask & 0x5555) << 1);
  mask = ((mask >> 2) & 0x3333) | ((mask & 0x3333) << 2);
  mask = ((mask >> 4) & 0x0F0F) | ((mask & 0x0F0F) << 4);
  mask = ((mask >> 8) & 0x00FF) | ((mask & 0x00FF) << 8);
  return mask;
}


x86 assembly (clang, -O0):
<reverse_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x5555,%eax
mov    -0x4(%rbp),%ecx
and    $0x5555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0x3333,%eax
mov    -0x4(%rbp),%ecx
and    $0x3333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf0f,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_mask>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @reverse_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 21845
%6 = load i32, i32* %2
%7 = and i32 %6, 21845
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 13107
%13 = load i32, i32* %2
%14 = and i32 %13, 13107
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 4
%19 = and i32 %18, 3855
%20 = load i32, i32* %2
%21 = and i32 %20, 3855
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = ashr i32 %24, 8
%26 = and i32 %25, 255
%27 = load i32, i32* %2
%28 = and i32 %27, 255
%29 = shl i32 %28, 8
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @reverse_mask(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bitreverse.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
double get_grade_point(int class_number) {
  double grade_point = 0.0;
  printf("Enter grade point for class %d: ", class_number);
  scanf("%lf", &grade_point);
  return grade_point;
}


x86 assembly (clang, -O0):
<get_grade_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_grade_point>:
push   %rax
mov    %edi,%esi
movq   $0x0,(%rsp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter grade point for class %d: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_grade_point(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter grade point for class %d: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_grade_point(i32 %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ displayTemperatureTable(int /*<<< orphan*/, int, int);
main() { displayTemperatureTable(0, 300, 20); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x12c,%esi
mov    $0x14,%edx
call   1030 <displayTemperatureTable@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @displayTemperatureTable(i32 0, i32 300, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @displayTemperatureTable(i32 0, i32 300, i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void escribir(int *p, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("p[%d]: %d\n", i, p[i]);
  }
}


x86 assembly (clang, -O0):
<escribir>:
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    115a <escribir+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <escribir+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"p[%d]: %d\0A\00"
define void @escribir(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
void output_string(str) const char *str;
{ output_bytes(str, strlen(str)); }


x86 assembly (clang, -O0):
<output_string>:
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   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
mov    $0x0,%al
call   1040 <output_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <output_bytes@plt>

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

LLVM IR (-O2):
define void @output_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @output_bytes to i32 (i8*, i64, ...)*)(i8* %0, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
void strtcpy(char *dest, char *src, size_t dest_size) {
  if (dest_size > 0) {
    strncpy(dest, src, dest_size - 1);
    dest[dest_size - 1] = '\0';
  }
}


x86 assembly (clang, -O0):
<strtcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1154 <strtcpy+0x44>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtcpy>:
test   %rdx,%rdx
je     1135 <strtcpy+0x25>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strtcpy(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add i64 %2, -1
%7 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %6)
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %8
br label %9
9: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int setgid(gid_t gid) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<setgid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setgid>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setgid(i32 %0) {
%2 = load i32, i32* @EPERM
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ maze_to_fig_line(int /*<<< orphan*/ *, int, int, int, int,
                                    int /*<<< orphan*/, int);
void maze_to_fig_cell_wall(FILE *fp, int row1, int col1, int row2, int col2,
                           int upc) {
  maze_to_fig_line(fp, col1 * upc, row1 * upc, col2 * upc, row2 * upc, 0, 50);
}


x86 assembly (clang, -O0):
<maze_to_fig_cell_wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
imul   -0x1c(%rbp),%esi
mov    -0xc(%rbp),%edx
imul   -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
imul   -0x1c(%rbp),%r8d
xor    %r9d,%r9d
movl   $0x32,(%rsp)
call   1030 <maze_to_fig_line@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_to_fig_cell_wall>:
push   %rax
mov    %ecx,%eax
mov    %esi,%ecx
imul   %r9d,%edx
imul   %r9d,%ecx
imul   %r9d,%r8d
imul   %r9d,%eax
movl   $0x32,(%rsp)
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <maze_to_fig_line@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @maze_to_fig_cell_wall(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %9
%15 = load i32, i32* %12
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %12
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = mul nsw i32 %20, %21
%23 = load i32, i32* %10
%24 = load i32, i32* %12
%25 = mul nsw i32 %23, %24
%26 = call i32 @maze_to_fig_line(i32* %13, i32 %16, i32 %19, i32 %22, i32 %25, i32 0, i32 50)
ret void
}

LLVM IR (-O2):
define void @maze_to_fig_cell_wall(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = mul nsw i32 %5, %2
%8 = mul nsw i32 %5, %1
%9 = mul nsw i32 %5, %4
%10 = mul nsw i32 %5, %3
%11 = tail call i32 @maze_to_fig_line(i32* %0, i32 %7, i32 %8, i32 %9, i32 %10, i32 0, i32 50)
ret void
}
/* Variables and functions */
int find_last_non_blank_char(char const *);
char *ft_strdup(char const *);
char *ft_strsub(char const *, int, int);
char *cut_string(char const *s, int pos_beg) {
  int pos_end;
  pos_end = find_last_non_blank_char(s);
  if (pos_end == -1)
    return (ft_strdup(s + pos_beg));
  return (ft_strsub(s, pos_beg, pos_end - pos_beg));
}


x86 assembly (clang, -O0):
<cut_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <find_last_non_blank_char@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    116e <cut_string+0x3e>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1040 <ft_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1184 <cut_string+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1030 <ft_strsub@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_string>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <find_last_non_blank_char@plt>
cmp    $0xffffffff,%eax
je     1156 <cut_string+0x26>
sub    %ebp,%eax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ft_strsub@plt>
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ft_strdup@plt>

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

LLVM IR (-O2):
define i8* @cut_string(i8* %0, i32 %1) {
%3 = tail call i32 @find_last_non_blank_char(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i8* @ft_strdup(i8* %7)
br label %12
9: ; preds = %2
%10 = sub nsw i32 %3, %1
%11 = tail call i8* @ft_strsub(i8* %0, i32 %1, i32 %10)
br label %12
12: ; preds = %9, %5
%13 = phi i8* [ %8, %5 ], [ %11, %9 ]
ret i8* %13
}
/* Type definitions */
struct list_lp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_lp_clear_callback(struct list_lp *,
                                          int /*<<< orphan*/ *);
void list_lp_clear(struct list_lp *target) {
  list_lp_clear_callback(target, NULL);
}


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

x86 assembly (clang, -O2):
<list_lp_clear>:
xor    %esi,%esi
jmp    1030 <list_lp_clear_callback@plt>

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

LLVM IR (-O2):
%struct.list_lp = type { i32 }
define void @list_lp_clear(%struct.list_lp* %0) {
%2 = tail call i32 @list_lp_clear_callback(%struct.list_lp* %0, i32* null)
ret void
}