xunge/DecIR huggingface dataset:
/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
signed int puts(const char *pStr) {
  signed int num = 0;
  num = fputs(pStr, stdout);
  fputs("\n", stdout);
  return num;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%esi
call   1030 <fputs@plt>
mov    %eax,%ebx
mov    (%r14),%esi
lea    0xed1(%rip),%rdi
call   1030 <fputs@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* @stdout
%6 = call i32 @fputs(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %3
}
int f_blt_rr1(float a1, float a2) { return (__builtin_isless(a1, a2)); }


x86 assembly (clang, -O0):
<f_blt_rr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_blt_rr1>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @f_blt_rr1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_blt_rr1(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ num(int);
int skipnops(void) {
  register int opcode;
  while ((opcode = (int)num(1)) == 138)
    ;
  return opcode;
}


x86 assembly (clang, -O0):
<skipnops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <num@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x8a,%eax
jne    1135 <skipnops+0x25>
jmp    1118 <skipnops+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipnops>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <num@plt>
cmp    $0x8a,%eax
je     1120 <skipnops+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @skipnops() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call i64 @num(i32 1)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = icmp eq i32 %4, 138
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @skipnops() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @num(i32 1)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 138
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = trunc i64 %2 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char const *argv[]) { return !strcmp("hello", "hello"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\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 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
struct i2c_slave {
  int dummy;
};

/* Variables and functions */
int i2c_sendSlaveCommand2(struct i2c_slave *, char *, int, char *, int);
int i2c_sendSlaveCommand(struct i2c_slave *slave, int cmd, char *response,
                         int size) {
  char buf[1];
  buf[0] = cmd;
  return i2c_sendSlaveCommand2(slave, buf, 1, response, size);
}


x86 assembly (clang, -O0):
<i2c_sendSlaveCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x1d(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x1d(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x1,%edx
call   1030 <i2c_sendSlaveCommand2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_sendSlaveCommand>:
push   %rax
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <i2c_sendSlaveCommand2@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.i2c_slave = type { i32 }
define i32 @i2c_sendSlaveCommand(%struct.i2c_slave* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.i2c_slave*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [1 x i8]
store %struct.i2c_slave* %0, %struct.i2c_slave** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 0
store i8 %11, i8* %12
%13 = load %struct.i2c_slave*, %struct.i2c_slave** %5
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %7
%16 = load i32, i32* %8
%17 = call i32 @i2c_sendSlaveCommand2(%struct.i2c_slave* %13, i8* %14, i32 1, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.i2c_slave = type { i32 }
define i32 @i2c_sendSlaveCommand(%struct.i2c_slave* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca [1 x i8]
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %1 to i8
store i8 %7, i8* %6
%8 = call i32 @i2c_sendSlaveCommand2(%struct.i2c_slave* %0, i8* %6, i32 1, i8* %2, i32 %3)
ret i32 %8
}
/* Variables and functions */
int foo1(int *, int *, int *, int *, int *);
int foo2(int *a, int *b, int *c, int *d) {
  int e = 5;
  return foo1(a, b, c, d, &e);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x5,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1030 <foo1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%r8
call   1030 <foo1@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo2(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 5, i32* %9
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @foo1(i32* %10, i32* %11, i32* %12, i32* %13, i32* %9)
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo2(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 5, i32* %5
%7 = call i32 @foo1(i32* %0, i32* %1, i32* %2, i32* %3, i32* %5)
ret i32 %7
}
/* Variables and functions */
float fabs(float);
float _abs(float s) { return fabs(s); }


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

x86 assembly (clang, -O2):
<_abs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @_abs(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @fabs(float %3)
ret float %4
}

LLVM IR (-O2):
define float @_abs(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned short);
unsigned short vga_offset(unsigned int, unsigned int);
void set_cursor(unsigned int row, unsigned int col) {
  unsigned short pos = vga_offset(row, col);
  outb(0x3d4, 0x0f);
  outb(0x3d5, (pos & 0xff));
  outb(0x3d4, 0x0e);
  outb(0x3d5, (pos >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vga_offset@plt>
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1040 <outb@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1040 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1040 <outb@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1040 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor>:
push   %rbx
call   1030 <vga_offset@plt>
movzwl %ax,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1040 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1040 <outb@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1040 <outb@plt>
shr    $0x8,%ebx
mov    $0x3d5,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <outb@plt>

LLVM IR (-O0):
define void @set_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call zeroext i16 @vga_offset(i32 %6, i32 %7)
store i16 %8, i16* %5
%9 = call i32 @outb(i32 980, i16 zeroext 15)
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i16
%14 = call i32 @outb(i32 981, i16 zeroext %13)
%15 = call i32 @outb(i32 980, i16 zeroext 14)
%16 = load i16, i16* %5
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i16
%21 = call i32 @outb(i32 981, i16 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @set_cursor(i32 %0, i32 %1) {
%3 = tail call zeroext i16 @vga_offset(i32 %0, i32 %1)
%4 = tail call i32 @outb(i32 980, i16 zeroext 15)
%5 = and i16 %3, 255
%6 = tail call i32 @outb(i32 981, i16 zeroext %5)
%7 = tail call i32 @outb(i32 980, i16 zeroext 14)
%8 = lshr i16 %3, 8
%9 = tail call i32 @outb(i32 981, i16 zeroext %8)
ret void
}
double centimetresToKm(double centimetres) { return centimetres / 100000.0; }


x86 assembly (clang, -O0):
<centimetresToKm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<centimetresToKm>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @centimetresToKm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+05
ret double %4
}

LLVM IR (-O2):
define double @centimetresToKm(double %0) {
%2 = fdiv double %0, 1.000000e+05
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sysflake_generate();
int main(void) {
  printf("%016llX\n", sysflake_generate());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <sysflake_generate@plt>
mov    %eax,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sysflake_generate@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%016llX\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @sysflake_generate()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int acase_le(const char *pat, const char *text) {
  return (strcasecmp(text, pat) <= 0);
}


x86 assembly (clang, -O0):
<acase_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acase_le>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @acase_le(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strcasecmp(i8* %5, i8* %6)
%8 = icmp sle i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @acase_le(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %1, i8* %0)
%4 = icmp slt i64 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
void WARN_PARAM(char *message) { (void)message; }


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

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

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

LLVM IR (-O2):
define void @WARN_PARAM(i8* nocapture %0) {
ret void
}
float delerp(float y0, float y1, float y) { return (y - y0) / (y1 - y); }


x86 assembly (clang, -O0):
<delerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<delerp>:
subss  %xmm2,%xmm1
subss  %xmm0,%xmm2
divss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @delerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fsub float %10, %11
%13 = fdiv float %9, %12
ret float %13
}

LLVM IR (-O2):
define float @delerp(float %0, float %1, float %2) {
%4 = fsub float %2, %0
%5 = fsub float %1, %2
%6 = fdiv float %4, %5
ret float %6
}
int ft_strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2++) {
    if (*s1++ == '\0')
      return (0);
  }
  return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
}


x86 assembly (clang, -O0):
<ft_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <ft_strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <ft_strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116d <ft_strcmp+0x6d>
jmp    110c <ft_strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <ft_strcmp+0x27>
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <ft_strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = zext i8 %6 to i32
%15 = zext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
int bgtInstruction(int i, int j) { return (i > j) ? 1 : 0; }


x86 assembly (clang, -O0):
<bgtInstruction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgtInstruction>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @bgtInstruction(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @bgtInstruction(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void help() {
  write(2,
        "usage: mkdir <opt><arg> <dirname>\n -h show help\n -m XXX specify "
        "mode\n",
        70);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x46,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x46,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"usage: mkdir <opt><arg> <dirname>\0A -h show help\0A -m XXX specify mode\0A\00"
define void @help() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 70)
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"usage: mkdir <opt><arg> <dirname>\0A -h show help\0A -m XXX specify mode\0A\00"
define void @help() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 70)
ret void
}
void pop_message(int type, int time) {}


x86 assembly (clang, -O0):
<pop_message>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pop_message(i32 %0, i32 %1) {
ret void
}
float fabs_float(float x) {
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<fabs_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fabs_float+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fabs_float+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs_float>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @fabs_float(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: codepages [-m]\n"
         "\t-m       Create isomini.cp only\n");
  printf("build date: "
         "Mar 15 2022"
         "\n\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: codepages [-m]\0A\09-m Create isomini.cp only\0A\00"
@.str.1 = [26 x i8] c"build date: Mar 15 2022\0A\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"Usage: codepages [-m]\0A\09-m Create isomini.cp only\00"
@str.2 = [25 x i8] c"build date: Mar 15 2022\0A\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_paths(char *email) {
  printf("Showing paths for %s\n", email);
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"Showing paths for %s\0A\00"
define void @show_paths(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float float_min(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<float_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <float_min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <float_min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @float_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @float_min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ __is_big_endian();
int __swab64(int);
extern int le64_to_native(uint64_t i) {
  if (__is_big_endian()) {
    return __swab64(i);
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<le64_to_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__is_big_endian@plt>
cmp    $0x0,%rax
je     114c <le64_to_native+0x2c>
mov    -0x8(%rbp),%edi
call   1040 <__swab64@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <le64_to_native+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le64_to_native>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__is_big_endian@plt>
test   %rax,%rax
je     1137 <le64_to_native+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__swab64@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @le64_to_native(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @__is_big_endian()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @__swab64(i32 %7)
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @le64_to_native(i32 %0) {
%2 = tail call i64 (...) @__is_big_endian()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__swab64(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long event;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
void set_XReparentEvent_event(void *_p, unsigned long _v) {
  ((XReparentEvent *)_p)->event = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XReparentEvent_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XReparentEvent_event>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XReparentEvent_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char name[40];
  printf("Enter your name:\n");
  scanf("%s", name);
  printf("Hello, %s\n", name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your name:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello, %s\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [11 x i8] c"Hello, %s\0A\00"
@str = [17 x i8] c"Enter your name:\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
void GP_break31(void) {}


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

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

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

LLVM IR (-O2):
define void @GP_break31() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void delayMinutes(int min) {
  usleep((min * 1000 * 1000 * 60));
  return;
}


x86 assembly (clang, -O0):
<delayMinutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3c,%eax,%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayMinutes>:
imul   $0x3938700,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delayMinutes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = mul nsw i32 %4, 1000
%6 = mul nsw i32 %5, 60
%7 = call i32 @usleep(i32 %6)
ret void
}

LLVM IR (-O2):
define void @delayMinutes(i32 %0) {
%2 = mul i32 %0, 60000000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void jsoo_wrap_event() { exit(1); }


x86 assembly (clang, -O0):
<jsoo_wrap_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<jsoo_wrap_event>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @jsoo_wrap_event() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @jsoo_wrap_event() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gmx_chi(int, char **);
int main(int argc, char *argv[]) {
  gmx_chi(argc, argv);
  return 0;
}


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

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

LLVM IR (-O0):
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_chi(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_chi(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led2Toggle();
void EchoP__Leds__led2Toggle(void) { LedsP__Leds__led2Toggle(); }


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

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

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

LLVM IR (-O2):
define void @EchoP__Leds__led2Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led2Toggle()
ret void
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_movc_a_indir_a_pc(struct em8051 *aCPU, int aPosition,
                             char *aBuffer) {
  sprintf(aBuffer, "MOVC  A, @A+PC");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_movc_a_indir_a_pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_movc_a_indir_a_pc>:
movabs $0x43502b4140202c,%rax
mov    %rax,0x7(%rdx)
movabs $0x2c41202043564f4d,%rax
20 41 2c
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [15 x i8] c"MOVC A, @A+PC\00"
define i32 @disasm_movc_a_indir_a_pc(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
@.str = [15 x i8] c"MOVC A, @A+PC\00"
define i32 @disasm_movc_a_indir_a_pc(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(15) %2, i8* align 1 dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 15, i1 false)
ret i32 1
}
double getTempo(double d, int v) { return d / v; }


x86 assembly (clang, -O0):
<getTempo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTempo>:
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @getTempo(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @getTempo(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %0, %3
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
void m_print(const mpfr_t valueToPrint) {}


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

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

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

LLVM IR (-O2):
define void @m_print(i32 %0) {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int unix_date(char const *, struct tm *);
int wfile_date(const char *filename, struct tm *filedate) {
  return (unix_date(filename, filedate));
}


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

x86 assembly (clang, -O2):
<wfile_date>:
jmp    1030 <unix_date@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @wfile_date(i8* %0, %struct.tm* %1) {
%3 = tail call i32 @unix_date(i8* %0, %struct.tm* %1)
ret i32 %3
}
int test_imm_8Cint16_mem(short *val) {
  return ((*val) & (0x8C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Cint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 140
%7 = icmp ne i32 %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_8Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 140
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *string) {
  char *new = xmalloc(strlen(string) + 1);
  strcpy(new, string);
  return new;
}


x86 assembly (clang, -O0):
<xstrdup>:
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 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
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):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(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* @xmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
float foo2(void) { return 1.0f / 0.0f; }


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @foo2() {
ret float 0x7FF0000000000000
}

LLVM IR (-O2):
define float @foo2() {
ret float 0x7FF0000000000000
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void handler(int sig) {
  pid_t pid;
  if ((pid = waitpid(-1, NULL, 0)) < 0) {
    fputs("waipid error", stderr);
  }
  printf("Handler reaped child %d\n", (int)pid);
  sleep(2);
  return;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <waitpid@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jge    117e <handler+0x3e>
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
lea    0xe87(%rip),%rdi
call   1040 <fputs@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    $0xffffffff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <waitpid@plt>
mov    %rax,%rbx
test   %rax,%rax
jns    116c <handler+0x2c>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
lea    0xe99(%rip),%rdi
call   1040 <fputs@plt>
lea    0xe9a(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
pop    %rbx
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"waipid error\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"Handler reaped child %d\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 @waitpid(i32 -1, i32* null, i32 0)
store i64 %4, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %3
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 @sleep(i32 2)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"waipid error\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"Handler reaped child %d\0A\00"
define void @handler(i32 %0) {
%2 = tail call i64 @waitpid(i32 -1, i32* null, i32 0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %1
%8 = trunc i64 %2 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = tail call i32 @sleep(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int, int /*<<< orphan*/);
void remove_fd(int epollfd, int fd) {
  epoll_ctl(epollfd, EPOLL_CTL_DEL, fd, 0);
  close(fd);
}


x86 assembly (clang, -O0):
<remove_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_fd>:
push   %rbx
mov    %esi,%ebx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1040 <epoll_ctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define void @remove_fd(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* @EPOLL_CTL_DEL
%7 = load i32, i32* %4
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32 0)
%9 = load i32, i32* %4
%10 = call i32 @close(i32 %9)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define void @remove_fd(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %0, i32 %3, i32 %1, i32 0)
%5 = tail call i32 @close(i32 %1)
ret void
}
/* Variables and functions */
double third_order_polynomial(double, double, double, double, double);
double mean_elongation_moon_sun(double jce) {
  return third_order_polynomial(1.0 / 189474.0, -0.0019142, 445267.11148,
                                297.85036, jce);
}


x86 assembly (clang, -O0):
<mean_elongation_moon_sun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm4
movsd  0xed6(%rip),%xmm0
movsd  0xed6(%rip),%xmm1
movsd  0xed6(%rip),%xmm2
movsd  0xed6(%rip),%xmm3
call   1030 <third_order_polynomial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean_elongation_moon_sun>:
movaps %xmm0,%xmm4
movsd  0xee5(%rip),%xmm0
movsd  0xee5(%rip),%xmm1
movsd  0xee5(%rip),%xmm2
movsd  0xee5(%rip),%xmm3
jmp    1030 <third_order_polynomial@plt>

LLVM IR (-O0):
define double @mean_elongation_moon_sun(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @third_order_polynomial(double 0x3ED622F61749A783, double -1.914200e-03, double 0x411B2D4C7227D029, double 0x40729D9B13165D3A, double %3)
ret double %4
}

LLVM IR (-O2):
define double @mean_elongation_moon_sun(double %0) {
%2 = tail call double @third_order_polynomial(double 0x3ED622F61749A783, double -1.914200e-03, double 0x411B2D4C7227D029, double 0x40729D9B13165D3A, double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ parseOptions(int, char **, int *);
int /*<<< orphan*/ parseParameters(int, char **, int *);
void parseCommandLine(int argc, char **argv) {
  int index;
  index = 1;
  parseOptions(argc, argv, &index);
  parseParameters(argc, argv, &index);
}


x86 assembly (clang, -O0):
<parseCommandLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <parseOptions@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <parseParameters@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseCommandLine>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    %r14,%rdx
call   1030 <parseOptions@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <parseParameters@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @parseCommandLine(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @parseOptions(i32 %6, i8** %7, i32* %5)
%9 = load i32, i32* %3
%10 = load i8**, i8*** %4
%11 = call i32 @parseParameters(i32 %9, i8** %10, i32* %5)
ret void
}

LLVM IR (-O2):
define void @parseCommandLine(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @parseOptions(i32 %0, i8** %1, i32* %3)
%6 = call i32 @parseParameters(i32 %0, i8** %1, i32* %3)
ret void
}