xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_WR_MODE;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int spi_set_mode(int fd, __u8 mode) {
  return ioctl(fd, SPI_IOC_WR_MODE, &mode);
}


x86 assembly (clang, -O0):
<spi_set_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_set_mode>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@SPI_IOC_WR_MODE = global i32 0
define i32 @spi_set_mode(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SPI_IOC_WR_MODE
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %3)
ret i32 %5
}
/* Variables and functions */
double random0();
double xrandom(double xl, double xh) { return (xl + (xh - xl) * random0()); }


x86 assembly (clang, -O0):
<xrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <random0@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrandom>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <random0@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @xrandom(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = call double (...) @random0()
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @xrandom(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @random0()
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
/* Variables and functions */
char MCP4461_GetValue(int, int);
char getSolderStepper1Current(void) { return MCP4461_GetValue(0x58, 0x00); }


x86 assembly (clang, -O0):
<getSolderStepper1Current>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
xor    %esi,%esi
call   1030 <MCP4461_GetValue@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSolderStepper1Current>:
mov    $0x58,%edi
xor    %esi,%esi
jmp    1030 <MCP4461_GetValue@plt>

LLVM IR (-O0):
define signext i8 @getSolderStepper1Current() {
%1 = call signext i8 @MCP4461_GetValue(i32 88, i32 0)
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @getSolderStepper1Current() {
%1 = tail call signext i8 @MCP4461_GetValue(i32 88, i32 0)
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./a.out [port] [lisnum] [my_addr]");
  exit(errno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: ./a.out [port] [lisnum] [my_addr]\00"
@errno = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Usage: ./a.out [port] [lisnum] [my_addr]\00"
@errno = global i32 0
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int a = 1;
  int b = 0;
  printf("going to calculate 1/0...\n");
  int c = a / b;
  exit(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   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x1c(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"going to calculate 1/0...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 0, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = sdiv i32 %10, %11
store i32 %12, i32* %8
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"going to calculate 1/0...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int replace_byte(int, int, int);
int main(void) {
  printf("%x\n", replace_byte(0x12345678, 2, 0xab));
  printf("%x\n", replace_byte(0x12345678, 0, 0xab));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x12345678,%edi
mov    $0x2,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x12345678,%edi
xor    %esi,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12345678,%edi
mov    $0x2,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x12345678,%edi
xor    %esi,%esi
mov    $0xab,%edx
call   1040 <replace_byte@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @replace_byte(i32 305419896, i32 2, i32 171)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @replace_byte(i32 305419896, i32 0, i32 171)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @replace_byte(i32 305419896, i32 2, i32 171)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @replace_byte(i32 305419896, i32 0, i32 171)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(const char *progName) {
  printf("Usage: hdcp_test <cycle_num>\n");
  printf("Note: Target must be connected to an HDMI monitor.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: hdcp_test <cycle_num>\0A\00"
@.str.1 = [52 x i8] c"Note: Target must be connected to an HDMI monitor.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Usage: hdcp_test <cycle_num>\00"
@str.2 = [51 x i8] c"Note: Target must be connected to an HDMI monitor.\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.2, i64 0, i64 0))
ret void
}
int nagbar_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nagbar_init() {
ret i32 0
}
void sifree_vector(v, nl, nh) int *v;
int nl, nh;
{ free((char *)(v + nl)); }


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

x86 assembly (clang, -O2):
<sifree_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sifree_vector(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to i8*
tail call void @free(i8* %6)
ret void
}
int test_imm_FBint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xFB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FBint64_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, 251
%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_FBint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1078036791296
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct aFILE {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int /*<<< orphan*/ *freopen(char const *, char const *, int /*<<< orphan*/);
FILE *my_freopen(const char *filename, const char *mode, struct aFILE *fp) {
  return freopen(filename, mode, _get_actual_fp(fp));
}


x86 assembly (clang, -O0):
<my_freopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <_get_actual_fp@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <freopen@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_freopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <_get_actual_fp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <freopen@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32* @my_freopen(i8* %0, i8* %1, %struct.aFILE* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.aFILE*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.aFILE* %2, %struct.aFILE** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.aFILE*, %struct.aFILE** %6
%10 = call i32 @_get_actual_fp(%struct.aFILE* %9)
%11 = call i32* @freopen(i8* %7, i8* %8, i32 %10)
ret i32* %11
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32* @my_freopen(i8* %0, i8* %1, %struct.aFILE* %2) {
%4 = tail call i32 @_get_actual_fp(%struct.aFILE* %2)
%5 = tail call i32* @freopen(i8* %0, i8* %1, i32 %4)
ret i32* %5
}
void emit_ordering_equal(struct processor_explicatory_state *process_state,
                         struct modern_stream *stream, void *stream_state,
                         struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_ordering_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_ordering_equal(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_ordering_equal(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("--usage--:\n-d [run background]\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"--usage--:\0A-d [run background]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"--usage--:\0A-d [run background]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_2() { pic_send_EOI_normal(2); }


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

x86 assembly (clang, -O2):
<isr_irq_2>:
mov    $0x2,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_2() {
%1 = call i32 @pic_send_EOI_normal(i32 2)
ret void
}

LLVM IR (-O2):
define void @isr_irq_2() {
%1 = tail call i32 @pic_send_EOI_normal(i32 2)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *a = "-100.23";
  char *b = "100e-2";
  int c;
  c = atoi(a) + atoi(b);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
lea    0xed2(%rip),%rdi
call   1040 <atoi@plt>
add    %eax,%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"-100.23\00"
@.str.1 = [7 x i8] c"100e-2\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @atoi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @atoi(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = add nsw i32 %2, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
void print_ipc_debug_message(fmt, a1, a2, a3, a4, a5) char *fmt, *a1, *a2, *a3,
    *a4, *a5;
{
  ldisplay("DEBUG: IPC: ");
  ldisplay(fmt, a1, a2, a3, a4, a5);
  ldisplay("\n");
}


x86 assembly (clang, -O0):
<print_ipc_debug_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <ldisplay@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    $0x0,%al
call   1030 <ldisplay@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <ldisplay@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ipc_debug_message>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <ldisplay@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
xor    %eax,%eax
call   1030 <ldisplay@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ldisplay@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"DEBUG: IPC: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_ipc_debug_message(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19)
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"DEBUG: IPC: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_ipc_debug_message(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, i8*, i8*, i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ldisplay to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
main() {
  int a;
  foo(a, a);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 undef, i32 undef)
ret i32 0
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorPerPixShading3DRenderer();
struct YsGLSL3DRenderer *
YsGLSLCreateVariColorPerPixShadingWithTexCoord3DRenderer(void) {
  return YsGLSLCreateVariColorPerPixShading3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateVariColorPerPixShadingWithTexCoord3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerPixShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateVariColorPerPixShadingWithTexCoord3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorPerPixShading3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
/* Variables and functions */
int /*<<< orphan*/ removeMonitor(char *);
void exitUptime(void) { removeMonitor("system/uptime"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"system/uptime\00"
define void @exitUptime() {
%1 = call i32 @removeMonitor(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"system/uptime\00"
define void @exitUptime() {
%1 = tail call i32 @removeMonitor(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int getPixelPositionX(int index, int width) { return (index % width); }


x86 assembly (clang, -O0):
<getPixelPositionX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPixelPositionX>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @getPixelPositionX(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ loop(int /*<<< orphan*/ *, void (*)(int));
void listener(int sock, void (*handler)(int)) {
  fd_set read_fd_set;
  FD_ZERO(&read_fd_set);
  FD_SET(sock, &read_fd_set);
  while (1) {
    loop(&read_fd_set, handler);
  }
}


x86 assembly (clang, -O0):
<listener>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1030 <loop@plt>
jmp    1154 <listener+0x24>

x86 assembly (clang, -O2):
<listener>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <FD_ZERO@plt>
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <loop@plt>
jmp    1160 <listener+0x30>

LLVM IR (-O0):
define void @listener(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca i32
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = call i32 @FD_ZERO(i32* %5)
%7 = load i32, i32* %3
%8 = call i32 @FD_SET(i32 %7, i32* %5)
br label %9
9: ; preds = %2, %9
%10 = load void (i32)*, void (i32)** %4
%11 = call i32 @loop(i32* %5, void (i32)* %10)
br label %9
}

LLVM IR (-O2):
define void @listener(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FD_ZERO(i32* %3)
%6 = call i32 @FD_SET(i32 %0, i32* %3)
br label %7
7: ; preds = %7, %2
%8 = call i32 @loop(i32* %3, void (i32)* %1)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int yesno2id(const char *str) {
  if (!strcmp(str, "yes"))
    return 1;
  else if (!strcmp(str, "no"))
    return 2;
  return -1;
}


x86 assembly (clang, -O0):
<yesno2id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <yesno2id+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1172 <yesno2id+0x62>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1166 <yesno2id+0x56>
movl   $0x2,-0x4(%rbp)
jmp    1172 <yesno2id+0x62>
jmp    116b <yesno2id+0x5b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yesno2id>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113c <yesno2id+0x2c>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %eax
sbb    %eax,%eax
or     $0x2,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [3 x i8] c"no\00"
define i32 @yesno2id(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vreportf(char *, char *, char const *, int /*<<< orphan*/);
void error_builtin(const char *fmt, va_list params) {
  vreportf("[E]", "", fmt, params);
}


x86 assembly (clang, -O0):
<error_builtin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xecf(%rip),%rsi
call   1030 <vreportf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_builtin>:
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee4(%rip),%rdi
lea    0xee0(%rip),%rsi
jmp    1030 <vreportf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"[E]\00"
@.str.1 = [1 x i8] zeroinitializer
define void @error_builtin(i8* %0, i32 %1) {
%3 = tail call i32 @vreportf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
int checkmd5(unsigned char *a, unsigned char *b) {
  return (strncmp((char *)a, (char *)b, 16));
}


x86 assembly (clang, -O0):
<checkmd5>:
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    $0x10,%edx
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkmd5>:
mov    $0x10,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @checkmd5(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 16)
ret i32 %3
}
/* Variables and functions */
scalar_t__ operar(int, int, int);
int strlen(char *);
bool es_operador(char *letras) {
  if (strlen(letras) != 1)
    return false;
  if (operar((int)*letras, 1, 3) == 0)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<es_operador>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
je     114a <es_operador+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    117d <es_operador+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <operar@plt>
cmp    $0x0,%rax
jne    1176 <es_operador+0x56>
movl   $0x0,-0x4(%rbp)
jmp    117d <es_operador+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<es_operador>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    114f <es_operador+0x2f>
movsbl (%rbx),%edi
mov    $0x1,%esi
mov    $0x3,%edx
call   1040 <operar@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @es_operador(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i64 @operar(i32 %11, i32 1, i32 3)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 0, i32* %2
br label %16
15: ; preds = %8
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @es_operador(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = tail call i64 @operar(i32 %6, i32 1, i32 3)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void PR_Free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @PR_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int systemIsLittleEndian() {
  static int i = 1;
  return (int)(*(char *)&i);
}


x86 assembly (clang, -O0):
<systemIsLittleEndian>:
push   %rbp
mov    %rsp,%rbp
movsbl 0x2f15(%rip),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@systemIsLittleEndian.i = internal global i32 1
define i32 @systemIsLittleEndian() {
%1 = load i8, i8* bitcast (i32* @systemIsLittleEndian.i to i8*)
%2 = sext i8 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @systemIsLittleEndian() {
ret i32 1
}
int test_imm_AAuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AAuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 170
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void gdk_window_get_toplevel() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_toplevel() {
ret void
}
/* Variables and functions */
void *fz_calloc(unsigned int, unsigned int);
void *zalloc(void *opaque, unsigned int items, unsigned int size) {
  return fz_calloc(items, size);
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <fz_calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <fz_calloc@plt>

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

LLVM IR (-O2):
define i8* @zalloc(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @fz_calloc(i32 %1, i32 %2)
ret i8* %4
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *xnew) {
  list_replace(old, xnew);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Type definitions */
struct stat64 {
  int dummy;
};

/* Variables and functions */
int __lxstat64(int, char const *, struct stat64 *);
int lstat64(const char *path, struct stat64 *buf) {
  return __lxstat64(1, path, buf);
}


x86 assembly (clang, -O0):
<lstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <__lxstat64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat64>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <__lxstat64@plt>

LLVM IR (-O0):
%struct.stat64 = type { i32 }
define i32 @lstat64(i8* %0, %struct.stat64* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat64*
store i8* %0, i8** %3
store %struct.stat64* %1, %struct.stat64** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat64*, %struct.stat64** %4
%7 = call i32 @__lxstat64(i32 1, i8* %5, %struct.stat64* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat64 = type { i32 }
define i32 @lstat64(i8* %0, %struct.stat64* %1) {
%3 = tail call i32 @__lxstat64(i32 1, i8* %0, %struct.stat64* %1)
ret i32 %3
}
void glRotatef(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glRotatef() {
ret void
}
void fd254(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
a:
  goto a;
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd254>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd254+0x7>

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

LLVM IR (-O0):
define void @fd254(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; preds = %42
br label %42
43: ; No predecessors!
%44 = load i32, i32* %2
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %46, %43
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd254(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
int /*<<< orphan*/ do_ButtonPress(int /*<<< orphan*/ *);
void do_ButtonRelease(XEvent *eventp) { do_ButtonPress(eventp); }


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

x86 assembly (clang, -O2):
<do_ButtonRelease>:
jmp    1030 <do_ButtonPress@plt>

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

LLVM IR (-O2):
define void @do_ButtonRelease(i32* %0) {
%2 = tail call i32 @do_ButtonPress(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jstp_tx_char(char);
void jstp_tx_obj_end_item() { jstp_tx_char(','); }


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

x86 assembly (clang, -O2):
<jstp_tx_obj_end_item>:
mov    $0x2c,%edi
jmp    1030 <jstp_tx_char@plt>

LLVM IR (-O0):
define void @jstp_tx_obj_end_item() {
%1 = call i32 @jstp_tx_char(i8 signext 44)
ret void
}

LLVM IR (-O2):
define void @jstp_tx_obj_end_item() {
%1 = tail call i32 @jstp_tx_char(i8 signext 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void stop1() {
  printf("Child process 1 is killed by parent!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<stop1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Child process 1 is killed by parent!\0A\00"
define void @stop1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"Child process 1 is killed by parent!\00"
define void @stop1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_computed_goto(int index) {
  void *addr[] = {&&label1, &&label2};
  printf("Jumping to address %p\n", addr[index]);
  goto *addr[index];
label1:
  return 1234;
label2:
  return 4567;
}


x86 assembly (clang, -O0):
<test_computed_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2cee(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ceb(%rip),%rax
mov    %rax,-0x18(%rbp)
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rsi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rax
mov    %rax,-0x28(%rbp)
jmp    1176 <test_computed_goto+0x66>
movl   $0x4d2,-0x4(%rbp)
jmp    116d <test_computed_goto+0x5d>
movl   $0x11d7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret
mov    -0x28(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<test_computed_goto>:
push   %rbx
movslq %edi,%rax
lea    0x2cf5(%rip),%rcx
mov    (%rcx,%rax,8),%rbx
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    *%rbx
mov    $0x4d2,%eax
pop    %rbx
ret
mov    $0x11d7,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_computed_goto.addr = [2 x i8*] [i8* blockaddress(@test_computed_goto, %15), i8* blockaddress(@test_computed_goto, %16)]
@.str = [23 x i8] c"Jumping to address %p\0A\00"
define i32 @test_computed_goto(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i8*]
store i32 %0, i32* %3
%5 = bitcast [2 x i8*]* %4 to i8*
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 %12
%14 = load i8*, i8** %13
br label %19
15: ; preds = %19
store i32 1234, i32* %2
br label %17
16: ; preds = %19
store i32 4567, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
19: ; preds = %1
%20 = phi i8* [ %14, %1 ]
indirectbr i8* %20, [label %15, label %16]
}

LLVM IR (-O2):
@__const.test_computed_goto.addr = [2 x i8*] [i8* blockaddress(@test_computed_goto, %7), i8* blockaddress(@test_computed_goto, %6)]
@.str = [23 x i8] c"Jumping to address %p\0A\00"
define i32 @test_computed_goto(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* @__const.test_computed_goto.addr, i64 0, i64 %2
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
indirectbr i8* %4, [label %7, label %6]
6: ; preds = %1
br label %7
7: ; preds = %1, %6
%8 = phi i32 [ 4567, %6 ], [ 1234, %1 ]
ret i32 %8
}