xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: ipsockopt [-M ngroups] [-r] [-v]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"usage: ipsockopt [-M ngroups] [-r] [-v]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"usage: ipsockopt [-M ngroups] [-r] [-v]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ getnextln(char *, int /*<<< orphan*/ *);
scalar_t__ printf(char *, char const *, char *);
void show(FILE *fp, const char *offset, char *buf) {
  while (printf("%s%s\n", offset, buf) >= 0 && getnextln(buf, fp))
    ;
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jl     1171 <show+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <getnextln@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1181 <show+0x61>
jmp    1186 <show+0x66>
jmp    1134 <show+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xec8(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
test   %rax,%rax
js     1163 <show+0x43>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <getnextln@plt>
test   %rax,%rax
jne    1140 <show+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define void @show(i32* %0, i8* %1, i8* %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i64 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i64 @getnextln(i8* %2, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %7
ret void
}
void testRegister(register const char *reg) {
  if (reg)
    (void)reg[0];
}


x86 assembly (clang, -O0):
<testRegister>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1113 <testRegister+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testRegister(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @testRegister(i8* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int detail;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcrossing_detail(void *_p, int _v) {
  ((XEvent *)_p)->xcrossing.detail = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcrossing_detail>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcrossing_detail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcrossing_detail(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
short int foo2(int x) { return x; }


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

x86 assembly (clang, -O2):
<foo2>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @foo2(i32 %0) {
%2 = trunc i32 %0 to i16
ret i16 %2
}
void gtk_button_box_get_child_secondary() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_box_get_child_secondary() {
ret void
}
int test_imm_8Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x8F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Fint64_highword_mem>:
testb  $0x8f,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 614180323328
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ceal_tvsig_init(int /*<<< orphan*/ *);
void ceal_tvsig_stop() { ceal_tvsig_init(NULL); }


x86 assembly (clang, -O0):
<ceal_tvsig_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ceal_tvsig_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceal_tvsig_stop>:
xor    %edi,%edi
jmp    1030 <ceal_tvsig_init@plt>

LLVM IR (-O0):
define void @ceal_tvsig_stop() {
%1 = call i32 @ceal_tvsig_init(i32* null)
ret void
}

LLVM IR (-O2):
define void @ceal_tvsig_stop() {
%1 = tail call i32 @ceal_tvsig_init(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void cleanup_int(int **x) { free(*x); }


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

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

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

LLVM IR (-O2):
define void @cleanup_int(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @free(i32* %2)
ret void
}
int debug_lpm_close(struct inode *inode, struct file *file) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @debug_lpm_close(%struct.inode* %0, %struct.file* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.file*
store %struct.inode* %0, %struct.inode** %3
store %struct.file* %1, %struct.file** %4
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @debug_lpm_close(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ prc_buff(char);
int /*<<< orphan*/ prcwd();
cwdprint() {
  prcwd();
  prc_buff('\n');
}


x86 assembly (clang, -O0):
<cwdprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <prcwd@plt>
mov    $0xa,%edi
call   1030 <prc_buff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwdprint>:
push   %rax
xor    %eax,%eax
call   1040 <prcwd@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <prc_buff@plt>

LLVM IR (-O0):
define i32 @cwdprint() {
%1 = alloca i32
%2 = call i32 (...) @prcwd()
%3 = call i32 @prc_buff(i8 signext 10)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @cwdprint() {
%1 = tail call i32 (...) @prcwd()
%2 = tail call i32 @prc_buff(i8 signext 10)
ret i32 undef
}
void option_set_unit2MODIF_CASELESS() {}


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

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

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

LLVM IR (-O2):
define void @option_set_unit2MODIF_CASELESS() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
double *new_dvec(int n) {
  double *p = (double *)malloc(sizeof(double) * n);
  return p;
}


x86 assembly (clang, -O0):
<new_dvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_dvec>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define double* @new_dvec(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
int main() { return 9; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 9
}
/* Variables and functions */
int log_level_from_string(char const *);
int /*<<< orphan*/ log_set_max_level(int);
int log_set_max_level_from_string(const char *e) {
  int t;
  t = log_level_from_string(e);
  if (t < 0)
    return t;
  log_set_max_level(t);
  return 0;
}


x86 assembly (clang, -O0):
<log_set_max_level_from_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <log_level_from_string@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114d <log_set_max_level_from_string+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <log_set_max_level_from_string+0x3c>
mov    -0x14(%rbp),%edi
call   1040 <log_set_max_level@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_set_max_level_from_string>:
push   %rax
call   1030 <log_level_from_string@plt>
test   %eax,%eax
js     1133 <log_set_max_level_from_string+0x13>
mov    %eax,%edi
call   1040 <log_set_max_level@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @log_set_max_level_from_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @log_level_from_string(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @log_set_max_level(i32 %12)
store i32 0, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @log_set_max_level_from_string(i8* %0) {
%2 = tail call i32 @log_level_from_string(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @log_set_max_level(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_int64_t(int /*<<< orphan*/ *, int);
int64_t atomic_dec_int64_t(int64_t *var) { return atomic_sub_int64_t(var, 1); }


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

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

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

LLVM IR (-O2):
define i32 @atomic_dec_int64_t(i32* %0) {
%2 = tail call i32 @atomic_sub_int64_t(i32* %0, i32 1)
ret i32 %2
}
void USART2_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @USART2_IRQHandler() {
ret void
}
int XGrabKeyboard() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @XGrabKeyboard() {
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *customStrdup(const char *s) {
  char *data = malloc(strlen(s) + 1);
  if (data)
    strcpy(data, s);
  return data;
}


x86 assembly (clang, -O0):
<customStrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <customStrdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<customStrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <customStrdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @customStrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ wctob(int /*<<< orphan*/);
void uninitvar_wctob(void) {
  wint_t wc;
  (void)wctob(wc);
}


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

x86 assembly (clang, -O2):
<uninitvar_wctob>:
jmp    1030 <wctob@plt>

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

LLVM IR (-O2):
define void @uninitvar_wctob() {
%1 = tail call i32 @wctob(i32 undef)
ret void
}
void HariMain(void) {
fin:
  goto fin;
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HariMain+0x9>
jmp    1109 <HariMain+0x9>

x86 assembly (clang, -O2):
<HariMain>:
jmp    1100 <HariMain>

LLVM IR (-O0):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int main(void) {
  int a[3];
  int b[2];
  &a[2] - &a[1];
  f(5, 6);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [2 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%6 = ptrtoint i32* %4 to i64
%7 = ptrtoint i32* %5 to i64
%8 = sub i64 %6, %7
%9 = sdiv exact i64 %8, 4
%10 = call i32 @f(i32 5, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5, i32 6)
ret i32 0
}
int fossil_isupper(char c) { return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<fossil_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <fossil_isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @fossil_isupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fossil_isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
char *RCSid() {
  return RCSid("$Id: fit.c,v 1.78.2.7 2013/08/21 18:38:32 sfeam Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: fit.c,v 1.78.2.7 2013/08/21 18:38:32 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
void ARGBToRGB24Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *dst, size_t n) { memset(dst, 0, n); }


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() {
#pragma omp task
  {
    printf("1");
#pragma omp task
    {
      printf("2");
#pragma omp task
      { printf("3"); }
#pragma omp barrier
    }
  }
#pragma omp task
  {
    printf("4");
#pragma omp task
    {
      printf("5");
#pragma omp task
      { printf("7"); }
#pragma omp task
      { printf("8"); }
#pragma omp taskwait
    }
#pragma omp task
    { printf("6"); }
  }
#pragma omp barrier
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x31,%edi
call   1030 <putchar@plt>
mov    $0x32,%edi
call   1030 <putchar@plt>
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
mov    $0x35,%edi
call   1030 <putchar@plt>
mov    $0x37,%edi
call   1030 <putchar@plt>
mov    $0x38,%edi
call   1030 <putchar@plt>
mov    $0x36,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @putchar(i32 49)
%2 = tail call i32 @putchar(i32 50)
%3 = tail call i32 @putchar(i32 51)
%4 = tail call i32 @putchar(i32 52)
%5 = tail call i32 @putchar(i32 53)
%6 = tail call i32 @putchar(i32 55)
%7 = tail call i32 @putchar(i32 56)
%8 = tail call i32 @putchar(i32 54)
ret void
}
/* Variables and functions */
char *sbrk(int);
char *_sbrk(int incr) { return sbrk(incr); }


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

x86 assembly (clang, -O2):
<_sbrk>:
jmp    1030 <sbrk@plt>

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

LLVM IR (-O2):
define i8* @_sbrk(i32 %0) {
%2 = tail call i8* @sbrk(i32 %0)
ret i8* %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main() {
  int ch;
  printf("Type ~ to stop: ");
  while (1) {
    ch = getchar();
    if (ch == '~' || ch == EOF)
      break;
    putchar(ch);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
je     1171 <main+0x41>
mov    -0x8(%rbp),%eax
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%eax
jne    1176 <main+0x46>
jmp    1183 <main+0x53>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    114b <main+0x1b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x7e,%eax
je     1167 <main+0x37>
mov    0x2e98(%rip),%rbx
cmp    (%rbx),%eax
je     1167 <main+0x37>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x7e,%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Type ~ to stop: \00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %13
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 126
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load i32, i32* %2
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8, %4
br label %16
13: ; preds = %8
%14 = load i32, i32* %2
%15 = call i32 @putchar(i32 %14)
br label %4
16: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Type ~ to stop: \00"
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 126
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %2, %4
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ %2, %0 ]
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 126
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %10, %12
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %15, label %7
15: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
size_t ALIGN_POWER2(size_t);
size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
  size_t m;
  if (l <= 2)
    return 2;
  m = ALIGN_POWER2(l);
  if (m == 0)
    return l;
  return m;
}


x86 assembly (clang, -O0):
<GREEDY_ALLOC_ROUND_UP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
ja     1134 <GREEDY_ALLOC_ROUND_UP+0x24>
movq   $0x2,-0x8(%rbp)
jmp    1161 <GREEDY_ALLOC_ROUND_UP+0x51>
mov    -0x10(%rbp),%rdi
call   1030 <ALIGN_POWER2@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <GREEDY_ALLOC_ROUND_UP+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1161 <GREEDY_ALLOC_ROUND_UP+0x51>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GREEDY_ALLOC_ROUND_UP>:
mov    $0x2,%eax
cmp    $0x3,%rdi
jb     112c <GREEDY_ALLOC_ROUND_UP+0x1c>
push   %rbx
mov    %rdi,%rbx
call   1030 <ALIGN_POWER2@plt>
test   %rax,%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @GREEDY_ALLOC_ROUND_UP(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ule i64 %5, 2
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 2, i64* %2
br label %17
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i64 @ALIGN_POWER2(i64 %9)
store i64 %10, i64* %4
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i64, i64* %3
store i64 %14, i64* %2
br label %17
15: ; preds = %8
%16 = load i64, i64* %4
store i64 %16, i64* %2
br label %17
17: ; preds = %15, %13, %7
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @GREEDY_ALLOC_ROUND_UP(i64 %0) {
%2 = icmp ult i64 %0, 3
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @ALIGN_POWER2(i64 %0)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 %0, i64 %4
br label %7
7: ; preds = %3, %1
%8 = phi i64 [ 2, %1 ], [ %6, %3 ]
ret i64 %8
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int __xstat(int ver __attribute__((unused)),
            const char *path __attribute__((unused)),
            struct stat *stat_buf __attribute__((unused))) {
  printf("__xstat\n");
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<__xstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [9 x i8] c"__xstat\0A\00"
@ENOENT = global i32 0
@errno = global i32 0
define i32 @__xstat(i32 %0, i8* %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @ENOENT
store i32 %8, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
@str = [8 x i8] c"__xstat\00"
define i32 @__xstat(i32 %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @ENOENT
store i32 %5, i32* @errno
ret i32 -1
}
void replace_char(char str[], char from, char to) {
  while (*str != '\0') {
    if (*str == from) {
      *str = to;
    }
    ++str;
  }
}


x86 assembly (clang, -O0):
<replace_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <replace_char+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <replace_char+0x3f>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <replace_char+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_char>:
mov    (%rdi),%al
test   %al,%al
je     1125 <replace_char+0x25>
add    $0x1,%rdi
jmp    111b <replace_char+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <replace_char+0x25>
cmp    %sil,%al
jne    1110 <replace_char+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <replace_char+0x10>
ret

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

LLVM IR (-O2):
define void @replace_char(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int x = 5;
  switch (x) {
  case 3:
    printf("3!\n");
    break;
  case 7:
    printf("7!\n");
    break;
  case -2:
    printf("-2!\n");
    break;
  default:
    printf("nope\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xfffffffe,%eax
je     1185 <main+0x75>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     1163 <main+0x53>
jmp    1152 <main+0x42>
mov    -0x18(%rbp),%eax
sub    $0x7,%eax
je     1174 <main+0x64>
jmp    1196 <main+0x86>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x92>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x92>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x92>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [5 x i8] c"nope\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ button_update();
int /*<<< orphan*/ cmps10_update_all();
int /*<<< orphan*/ gps_update();
void update_all_inputs(void) {
  button_update();
  cmps10_update_all();
  gps_update();
  return;
}


x86 assembly (clang, -O0):
<update_all_inputs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <button_update@plt>
mov    $0x0,%al
call   1040 <cmps10_update_all@plt>
mov    $0x0,%al
call   1030 <gps_update@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_all_inputs>:
push   %rax
xor    %eax,%eax
call   1050 <button_update@plt>
xor    %eax,%eax
call   1040 <cmps10_update_all@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gps_update@plt>

LLVM IR (-O0):
define void @update_all_inputs() {
%1 = call i32 (...) @button_update()
%2 = call i32 (...) @cmps10_update_all()
%3 = call i32 (...) @gps_update()
ret void
}

LLVM IR (-O2):
define void @update_all_inputs() {
%1 = tail call i32 (...) @button_update()
%2 = tail call i32 (...) @cmps10_update_all()
%3 = tail call i32 (...) @gps_update()
ret void
}
void DPMSDisable() {}


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

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

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

LLVM IR (-O2):
define void @DPMSDisable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ tcdrain(int);
int write(int, void *, int);
int send_serial(int fd, void *command, int length) {
  int status = 0;
  status = write(fd, command, length);
  tcdrain(fd);
  if (status < 0) {
    perror("write");
  }
  return status;
}


x86 assembly (clang, -O0):
<send_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <write@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tcdrain@plt>
cmpl   $0x0,-0x18(%rbp)
jge    1179 <send_serial+0x49>
lea    0xe8c(%rip),%rdi
call   1050 <perror@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_serial>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <write@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <tcdrain@plt>
test   %ebx,%ebx
js     1150 <send_serial+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea9(%rip),%rdi
call   1050 <perror@plt>
jmp    1147 <send_serial+0x17>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define i32 @send_serial(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = tail call i32 @tcdrain(i32 %0)
%6 = icmp slt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret i32 %4
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_callback {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_callback_get_user_data(struct wl_callback *wl_callback) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_callback);
}


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

x86 assembly (clang, -O2):
<wl_callback_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_callback_get_user_data(%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 i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_callback = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_callback_get_user_data(%struct.wl_callback* %0) {
%2 = bitcast %struct.wl_callback* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
void gtk_bindings_activate() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB4444Row_SSE2() {
ret void
}
/* Variables and functions */
char *itex2MML_copy3(char const *, char const *, int /*<<< orphan*/);
char *itex2MML_copy2(const char *first, const char *second) {
  return itex2MML_copy3(first, second, 0);
}


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

x86 assembly (clang, -O2):
<itex2MML_copy2>:
xor    %edx,%edx
jmp    1030 <itex2MML_copy3@plt>

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

LLVM IR (-O2):
define i8* @itex2MML_copy2(i8* %0, i8* %1) {
%3 = tail call i8* @itex2MML_copy3(i8* %0, i8* %1, i32 0)
ret i8* %3
}
/* Variables and functions */
char *abi();
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  printf("%s %s\n", argv[1], abi());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <abi@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
xor    %eax,%eax
call   1040 <abi@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* (...) @abi()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void chop_newline(char *line) {
  int newline_pos = strlen(line) - 1;
  if (newline_pos >= 0 && line[newline_pos] == '\n') {
    line[newline_pos] = '\0';
  }
}


x86 assembly (clang, -O0):
<chop_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1156 <chop_newline+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1156 <chop_newline+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chop_newline+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chop_newline+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chop_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long atoll(const char *s) { return (strtoll(s, (char **)0, 10)); }


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

x86 assembly (clang, -O2):
<atoll>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @atoll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtoll(i8* %3, i8** null, i32 10)
ret i64 %4
}

LLVM IR (-O2):
define i64 @atoll(i8* nocapture %0) {
%2 = tail call i64 @strtoll(i8* nocapture %0, i8** null, i32 10)
ret i64 %2
}