xunge/DecIR huggingface dataset:
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSolidSphere(double, int, int);
void light_display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glutSolidSphere(1.0, 20, 16);
  glFlush();
}


x86 assembly (clang, -O0):
<light_display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xead(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<light_display>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <glClear@plt>
movsd  0xeb0(%rip),%xmm0
mov    $0x14,%edi
mov    $0x10,%esi
call   1050 <glutSolidSphere@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @light_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @light_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glutSolidSphere(double 1.000000e+00, i32 20, i32 16)
%6 = tail call i32 (...) @glFlush()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_proxy {
  int dummy;
};
struct wl_callback {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_get_version(struct wl_proxy *);
uint32_t wl_callback_get_version(struct wl_callback *wl_callback) {
  return wl_proxy_get_version((struct wl_proxy *)wl_callback);
}


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

x86 assembly (clang, -O2):
<wl_callback_get_version>:
jmp    1030 <wl_proxy_get_version@plt>

LLVM IR (-O0):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_callback_get_version(%struct.wl_callback* %0) {
%2 = alloca %struct.wl_callback*
store %struct.wl_callback* %0, %struct.wl_callback** %2
%3 = load %struct.wl_callback*, %struct.wl_callback** %2
%4 = bitcast %struct.wl_callback* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_get_version(%struct.wl_proxy* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_callback_get_version(%struct.wl_callback* %0) {
%2 = bitcast %struct.wl_callback* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_get_version(%struct.wl_proxy* %2)
ret i32 %3
}
long double sum(long double g, long double f) { return g + f; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @sum(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printIntArray(int *A, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d ", A[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printIntArray>:
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    1159 <printIntArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printIntArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printIntArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printIntArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printIntArray(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 = %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printIntArray(i32* 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 i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void *do_malloc(size_t, int /*<<< orphan*/);
void *ps_malloc(size_t size) {
  void *ret = do_malloc(size, 0);
  return ret;
}


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

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

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

LLVM IR (-O2):
define i8* @ps_malloc(i64 %0) {
%2 = tail call i8* @do_malloc(i64 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *prog_name) {
  fprintf(stderr, "usage: %s <thread_count> <digraph file>\n", prog_name);
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s <thread_count> <digraph file>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: %s <thread_count> <digraph file>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ printf(char *, char *);
int read(int /*<<< orphan*/, char *, int);
void input_handler(int num) {
  char data[100];
  int len;
  len = read(STDIN_FILENO, data, 100);
  data[len] = '\0';
  printf("input available: %s\n", data);
}


x86 assembly (clang, -O0):
<input_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
call   1040 <read@plt>
mov    %eax,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
lea    -0x70(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_handler>:
push   %rbx
sub    $0x70,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x64,%edx
call   1040 <read@plt>
cltq
movb   $0x0,(%rsp,%rax,1)
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@.str = [21 x i8] c"input available: %s\0A\00"
define void @input_handler(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @STDIN_FILENO
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 100)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %9
store i8 0, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@.str = [21 x i8] c"input available: %s\0A\00"
define void @input_handler(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @STDIN_FILENO
%5 = call i32 @read(i32 %4, i8* %3, i32 100)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ realloc(char **, int);
void *vector_push(char ***pointer, size_t *size, void *elem) {
  *pointer = (char **)realloc(*pointer, sizeof(char *) * (*size + 1));
  (*pointer)[*size] = elem;
  *size += 1;
  return elem;
}


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

x86 assembly (clang, -O2):
<vector_push>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    (%rdi),%rdi
mov    (%rsi),%eax
lea    0x8(,%rax,8),%esi
call   1030 <realloc@plt>
mov    %rax,(%r15)
mov    (%rbx),%rcx
mov    %r14,(%rax,%rcx,8)
add    $0x1,%rcx
mov    %rcx,(%rbx)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @vector_push(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 i8**, i8*** %7
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = add i64 %10, 1
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @realloc(i8** %8, i32 %13)
%15 = inttoptr i64 %14 to i8**
%16 = load i8***, i8**** %4
store i8** %15, i8*** %16
%17 = load i8*, i8** %6
%18 = load i8***, i8**** %4
%19 = load i8**, i8*** %18
%20 = load i64*, i64** %5
%21 = load i64, i64* %20
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
store i8* %17, i8** %22
%23 = load i64*, i64** %5
%24 = load i64, i64* %23
%25 = add i64 %24, 1
store i64 %25, i64* %23
%26 = load i8*, i8** %6
ret i8* %26
}

LLVM IR (-O2):
define i8* @vector_push(i8*** nocapture %0, i64* nocapture %1, i8* returned %2) {
%4 = load i8**, i8*** %0
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 3
%8 = add i32 %7, 8
%9 = tail call i64 @realloc(i8** %4, i32 %8)
%10 = inttoptr i64 %9 to i8**
store i8** %10, i8*** %0
%11 = load i64, i64* %1
%12 = getelementptr inbounds i8*, i8** %10, i64 %11
store i8* %2, i8** %12
%13 = add i64 %11, 1
store i64 %13, i64* %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void pcspeaker_play(int freq, int millis) { puts("Beep!"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Beep!\00"
define void @pcspeaker_play(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ get_line(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
char *get_pwd() {
  static char pwd[128];
  FILE *p;
  p = popen("pwd", "r");
  get_line(pwd, p);
  pclose(p);
  return pwd;
}


x86 assembly (clang, -O0):
<get_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2ef6(%rip),%rdi
call   1030 <get_line@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pclose@plt>
lea    0x2ee1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pwd>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0x2eff(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <get_line@plt>
mov    %rbx,%rdi
call   1040 <pclose@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_pwd.pwd = internal global [128 x i8] zeroinitializer
@.str = [4 x i8] c"pwd\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @get_pwd() {
%1 = alloca i32*
%2 = call i32* @popen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @get_line(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_pwd.pwd, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @pclose(i32* %5)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_pwd.pwd, i64 0, i64 0)
}

LLVM IR (-O2):
@get_pwd.pwd = internal global [128 x i8] zeroinitializer
@.str = [4 x i8] c"pwd\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @get_pwd() {
%1 = tail call i32* @popen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @get_line(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_pwd.pwd, i64 0, i64 0), i32* %1)
%3 = tail call i32 @pclose(i32* %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_pwd.pwd, i64 0, i64 0)
}
int ipmi_close_lan2(char *node) { return (-8); }


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

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

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

LLVM IR (-O2):
define i32 @ipmi_close_lan2(i8* nocapture readnone %0) {
ret i32 -8
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t int16PackSize(const int16_t *data) { return sizeof(*data); }


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

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

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

LLVM IR (-O2):
define i64 @int16PackSize(i32* nocapture readnone %0) {
ret i64 4
}
/* Type definitions */
struct nsxml_program_result {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct nsxml_program_result *);
int /*<<< orphan*/ nsxml_program_result_cleanup(struct nsxml_program_result *);
void nsxml_program_result_free(struct nsxml_program_result *result) {
  nsxml_program_result_cleanup(result);
  free(result);
}


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

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

LLVM IR (-O0):
%struct.nsxml_program_result = type { i32 }
define void @nsxml_program_result_free(%struct.nsxml_program_result* %0) {
%2 = alloca %struct.nsxml_program_result*
store %struct.nsxml_program_result* %0, %struct.nsxml_program_result** %2
%3 = load %struct.nsxml_program_result*, %struct.nsxml_program_result** %2
%4 = call i32 @nsxml_program_result_cleanup(%struct.nsxml_program_result* %3)
%5 = load %struct.nsxml_program_result*, %struct.nsxml_program_result** %2
%6 = call i32 @free(%struct.nsxml_program_result* %5)
ret void
}

LLVM IR (-O2):
%struct.nsxml_program_result = type { i32 }
define void @nsxml_program_result_free(%struct.nsxml_program_result* %0) {
%2 = tail call i32 @nsxml_program_result_cleanup(%struct.nsxml_program_result* %0)
%3 = tail call i32 @free(%struct.nsxml_program_result* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: make_modem_rx_filter -m <V.17 | V.22bis | V.22bis1200 | "
          "V.22bis2400 | V.27ter2400 | V.27ter4800 | V.29> [-i] [-r] [-t]\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [127 x i8] c"Usage: make_modem_rx_filter -m <V.17 | V.22bis | V.22bis1200 | V.22bis2400 | V.27ter2400 | V.27ter4800 | V.29> [-i] [-r] [-t]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [127 x i8] c"Usage: make_modem_rx_filter -m <V.17 | V.22bis | V.22bis1200 | V.22bis2400 | V.27ter2400 | V.27ter4800 | V.29> [-i] [-r] [-t]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}
char test_59_0(char *mem) { return __atomic_fetch_xor(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_59_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_59_0+0x4a>
jmp    111f <test_59_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_59_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
xor    $0x1,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_59_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_59_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_59_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 1 acq_rel
ret i8 %2
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
char *strptime(char *, char *, struct tm *);
int32_t read_time(char **pointer, struct tm *value) {
  *pointer = strptime(*pointer, "%y%m%d %H%M%S", value);
  return *pointer != NULL;
}


x86 assembly (clang, -O0):
<read_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <strptime@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_time>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0xedf(%rip),%rsi
call   1030 <strptime@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [14 x i8] c"%y%m%d %H%M%S\00"
define i32 @read_time(i8** %0, %struct.tm* %1) {
%3 = alloca i8**
%4 = alloca %struct.tm*
store i8** %0, i8*** %3
store %struct.tm* %1, %struct.tm** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = load %struct.tm*, %struct.tm** %4
%8 = call i8* @strptime(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [14 x i8] c"%y%m%d %H%M%S\00"
define i32 @read_time(i8** nocapture %0, %struct.tm* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @strptime(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.tm* %1)
store i8* %4, i8** %0
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ chaz_ConfWriter_end_module();
int /*<<< orphan*/ chaz_ConfWriter_start_module(char *);
int /*<<< orphan*/ chaz_Strings_probe_c99_snprintf();
void chaz_Strings_run(void) {
  chaz_ConfWriter_start_module("Strings");
  chaz_Strings_probe_c99_snprintf();
  chaz_ConfWriter_end_module();
}


x86 assembly (clang, -O0):
<chaz_Strings_run>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <chaz_ConfWriter_start_module@plt>
mov    $0x0,%al
call   1040 <chaz_Strings_probe_c99_snprintf@plt>
mov    $0x0,%al
call   1050 <chaz_ConfWriter_end_module@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_Strings_run>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <chaz_ConfWriter_start_module@plt>
xor    %eax,%eax
call   1040 <chaz_Strings_probe_c99_snprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <chaz_ConfWriter_end_module@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Strings\00"
define void @chaz_Strings_run() {
%1 = call i32 @chaz_ConfWriter_start_module(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @chaz_Strings_probe_c99_snprintf()
%3 = call i32 (...) @chaz_ConfWriter_end_module()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Strings\00"
define void @chaz_Strings_run() {
%1 = tail call i32 @chaz_ConfWriter_start_module(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @chaz_Strings_probe_c99_snprintf()
%3 = tail call i32 (...) @chaz_ConfWriter_end_module()
ret void
}
/* Variables and functions */
int test_int(char *);
int test_long(char *);
int test_longlong(char *);
int test_short(char *);
int main(void) {
  long buf[2] = {0, 0};
  char *ptr = ((char *)buf) + 1;
  return (test_short(ptr) + test_int(ptr) + test_long(ptr) +
          test_longlong(ptr)) == 10
             ? 0
             : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <test_short@plt>
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <test_int@plt>
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <test_long@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <test_longlong@plt>
mov    -0x2c(%rbp),%edx
add    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0xa,%edx
cmove  %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x1(%rsp),%r14
mov    %r14,%rdi
call   1060 <test_short@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1050 <test_int@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    %r14,%rdi
call   1040 <test_long@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    %r14,%rdi
call   1030 <test_longlong@plt>
add    %ebp,%eax
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i64]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [2 x i64]* %2 to i8*
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%6 = bitcast i64* %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @test_short(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @test_int(i8* %10)
%12 = add nsw i32 %9, %11
%13 = load i8*, i8** %3
%14 = call i32 @test_long(i8* %13)
%15 = add nsw i32 %12, %14
%16 = load i8*, i8** %3
%17 = call i32 @test_longlong(i8* %16)
%18 = add nsw i32 %15, %17
%19 = icmp eq i32 %18, 10
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 1
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i64]
%2 = bitcast [2 x i64]* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = call i32 @test_short(i8* %3)
%5 = call i32 @test_int(i8* %3)
%6 = add nsw i32 %5, %4
%7 = call i32 @test_long(i8* %3)
%8 = add nsw i32 %6, %7
%9 = call i32 @test_longlong(i8* %3)
%10 = add nsw i32 %8, %9
%11 = icmp ne i32 %10, 10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void lamp_on(const char id[2]) {
  char command[5];
  command[0] = 'L';
  command[1] = id[0];
  command[2] = id[1];
  command[3] = '1';
  command[4] = '\n';
  printf("%s", command);
}


x86 assembly (clang, -O0):
<lamp_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x4c,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xb(%rbp)
movb   $0x31,-0xa(%rbp)
movb   $0xa,-0x9(%rbp)
lea    -0xd(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lamp_on>:
push   %rax
movb   $0x4c,0x3(%rsp)
mov    (%rdi),%al
mov    %al,0x4(%rsp)
mov    0x1(%rdi),%al
mov    %al,0x5(%rsp)
movw   $0xa31,0x6(%rsp)
lea    0xecf(%rip),%rdi
lea    0x3(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @lamp_on(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
store i8 76, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 2
store i8 %11, i8* %12
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 3
store i8 49, i8* %13
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 10, i8* %14
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @lamp_on(i8* nocapture %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
store i8 76, i8* %3
%4 = load i8, i8* %0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
store i8 %4, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
store i8 %7, i8* %8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 3
store i8 49, i8* %9
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
store i8 10, i8* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
void _mesa_align_free(void *ptr) {
  void **cubbyHole = (void **)((char *)ptr - sizeof(void *));
  void *realAddr = *cubbyHole;
  free(realAddr);
}


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

x86 assembly (clang, -O2):
<_mesa_align_free>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_mesa_align_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
ret void
}
void str_replace_cr_space(char *src) {
  char *ptr = src;
  while (*ptr++ != '\0') {
    if ((*ptr == '\r') || (*ptr == '\n') || (*ptr == ' ')) {
      *ptr = '\0';
      break;
    }
  }
}


x86 assembly (clang, -O0):
<str_replace_cr_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116c <str_replace_cr_space+0x6c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     115b <str_replace_cr_space+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115b <str_replace_cr_space+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1167 <str_replace_cr_space+0x67>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    116c <str_replace_cr_space+0x6c>
jmp    1110 <str_replace_cr_space+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_replace_cr_space>:
mov    (%rdi),%cl
add    $0x1,%rdi
movabs $0x100002400,%rax
test   %cl,%cl
je     112b <str_replace_cr_space+0x2b>
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%rcx
ja     1110 <str_replace_cr_space+0x10>
bt     %rcx,%rax
jae    1110 <str_replace_cr_space+0x10>
movb   $0x0,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @str_replace_cr_space(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %8, %1
%4 = phi i8 [ %9, %8 ], [ %2, %1 ]
%5 = phi i8* [ %6, %8 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = icmp eq i8 %4, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = load i8, i8* %6
switch i8 %9, label %3 [
i8 13, label %10
i8 10, label %10
i8 32, label %10
]
10: ; preds = %8, %8, %8
store i8 0, i8* %6
br label %11
11: ; preds = %3, %10
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AONRTCIncValueCh2Get(void) {
  return ((*((volatile unsigned long *)(0x40092000 + 0x00000024))));
}


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

x86 assembly (clang, -O2):
<AONRTCIncValueCh2Get>:
mov    0x40092024,%rax
40
ret

LLVM IR (-O0):
define i64 @AONRTCIncValueCh2Get() {
%1 = load volatile i64, i64* inttoptr (i64 1074339876 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @AONRTCIncValueCh2Get() {
%1 = load volatile i64, i64* inttoptr (i64 1074339876 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ lte_send_modem(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void send_at_cmd(char *c) {
  char buf[100];
  memset(buf, 0, 100);
  sprintf(buf, "%s\r\n", c);
  printf("sending %s", buf);
  lte_send_modem(buf);
}


x86 assembly (clang, -O0):
<send_at_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <lte_send_modem@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_at_cmd>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
lea    0xe90(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <lte_send_modem@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0D\0A\00"
@.str.1 = [11 x i8] c"sending %s\00"
define void @send_at_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 100)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @lte_send_modem(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
@.str.1 = [11 x i8] c"sending %s\00"
define void @send_at_cmd(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 100)
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @lte_send_modem(i8* %3)
ret void
}
void caller_2_1_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_1_1_1_2() {
ret void
}
void set(int *string, unsigned n) {
  int bit = n % 32;
  int word = n / 32;
  string[word] |= 1 << bit;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
mov    %esi,%ecx
mov    %esi,%eax
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x5,%eax
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = urem i32 %7, 32
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = udiv i32 %9, 32
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = shl i32 1, %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = or i32 %17, %12
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @set(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = lshr i32 %1, 5
%5 = shl nuw i32 1, %3
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %5
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
float somatorio(int);
void wesley_safadao(int dia, int mes, float ano) {
  float safadeza, anjo;
  safadeza = somatorio(mes) + (ano / 100) * (50 - dia);
  anjo = 100 - safadeza;
  printf("%.1f %% ANJO, mas o %.1f %% eh VAGABUNDO!\n", anjo, safadeza);
}


x86 assembly (clang, -O0):
<wesley_safadao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <somatorio@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
movss  0xeb5(%rip),%xmm2
divss  %xmm2,%xmm0
mov    $0x32,%eax
sub    -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe90(%rip),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wesley_safadao>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <somatorio@plt>
movss  0xec4(%rip),%xmm2
movss  0xc(%rsp),%xmm3
divss  %xmm2,%xmm3
mov    $0x32,%eax
sub    %ebx,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm3,%xmm1
addss  %xmm0,%xmm1
subss  %xmm1,%xmm2
lea    0xea0(%rip),%rdi
movaps %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"%.1f %% ANJO, mas o %.1f %% eh VAGABUNDO!\0A\00"
define void @wesley_safadao(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%9 = load i32, i32* %5
%10 = call float @somatorio(i32 %9)
%11 = load float, float* %6
%12 = fdiv float %11, 1.000000e+02
%13 = load i32, i32* %4
%14 = sub nsw i32 50, %13
%15 = sitofp i32 %14 to float
%16 = call float @llvm.fmuladd.f32(float %12, float %15, float %10)
store float %16, float* %7
%17 = load float, float* %7
%18 = fsub float 1.000000e+02, %17
store float %18, float* %8
%19 = load float, float* %8
%20 = load float, float* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %19, float %20)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"%.1f %% ANJO, mas o %.1f %% eh VAGABUNDO!\0A\00"
define void @wesley_safadao(i32 %0, i32 %1, float %2) {
%4 = tail call float @somatorio(i32 %1)
%5 = fdiv float %2, 1.000000e+02
%6 = sub nsw i32 50, %0
%7 = sitofp i32 %6 to float
%8 = tail call float @llvm.fmuladd.f32(float %5, float %7, float %4)
%9 = fsub float 1.000000e+02, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %9, float %8)
ret void
}
/* Variables and functions */
int logmsg(char *, char *, int);
int eslib_logcritical(char *name, char *msg) { return logmsg(name, msg, 3); }


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

x86 assembly (clang, -O2):
<eslib_logcritical>:
mov    $0x3,%edx
jmp    1030 <logmsg@plt>

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

LLVM IR (-O2):
define i32 @eslib_logcritical(i8* %0, i8* %1) {
%3 = tail call i32 @logmsg(i8* %0, i8* %1, i32 3)
ret i32 %3
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main(void) {
  putchar('\n');
  bool test_lex(void);
  printf("Testing lexing.\n");
  if (!test_lex()) {
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
call   1050 <test_lex@plt>
cmp    $0x0,%eax
jne    1174 <main+0x44>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1180 <main+0x50>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
call   1050 <test_lex@plt>
test   %eax,%eax
jne    1159 <main+0x29>
mov    0x2e89(%rip),%rax
jmp    1160 <main+0x30>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Testing lexing.\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @test_lex()
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = load i32, i32* @EXIT_FAILURE
store i32 %7, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* @EXIT_SUCCESS
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"Testing lexing.\00"
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @test_lex()
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ld_a_bcp(void) { op_write1(0x0a); }


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

x86 assembly (clang, -O2):
<op_enc_ld_a_bcp>:
mov    $0xa,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ld_a_bcp() {
%1 = call i32 @op_write1(i32 10)
ret void
}

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


x86 assembly (clang, -O0):
<pa_channel_map_init_auto>:
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_channel_map_init_auto>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_channel_map_init_auto\00"
define i32 @pa_channel_map_init_auto() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int sub_help(struct global_options *g, int argc, char *argv[]) {}


x86 assembly (clang, -O0):
<sub_help>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.global_options = type opaque
define i32 @sub_help(%struct.global_options* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.global_options*
%6 = alloca i32
%7 = alloca i8**
store %struct.global_options* %0, %struct.global_options** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.global_options = type opaque
define i32 @sub_help(%struct.global_options* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
ret i32 undef
}