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

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int tcpDelayCtl(char *err, int fd, int val) {
  if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof(val)) == -1)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<tcpDelayCtl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    115b <tcpDelayCtl+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <tcpDelayCtl+0x52>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpDelayCtl>:
push   %rax
mov    %esi,%edi
mov    %edx,0x4(%rsp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @tcpDelayCtl(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %1, i32 %5, i32 %6, i32* %4, i32 4)
%8 = icmp eq i32 %7, -1
%9 = select i1 %8, i32 -1, i32 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void w_copy(unsigned int dst, const unsigned int src, int size) {
  memcpy((void *)(0xB8000 + (dst << 1)), (void *)(0xB8000 + (src << 1)),
         size << 1);
}


x86 assembly (clang, -O0):
<w_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0xb8000,%eax
mov    %eax,%eax
mov    %eax,%edi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0xb8000,%eax
mov    %eax,%eax
mov    %eax,%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_copy>:
add    %edi,%edi
add    $0xb8000,%edi
add    %esi,%esi
add    $0xb8000,%esi
add    %edx,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @w_copy(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 = shl i32 %7, 1
%9 = add i32 753664, %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load i32, i32* %5
%13 = shl i32 %12, 1
%14 = add i32 753664, %13
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = load i32, i32* %6
%18 = shl i32 %17, 1
%19 = call i32 @memcpy(i8* %11, i8* %16, i32 %18)
ret void
}

LLVM IR (-O2):
define void @w_copy(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 1
%5 = add i32 %4, 753664
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = shl i32 %1, 1
%9 = add i32 %8, 753664
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = shl i32 %2, 1
%13 = tail call i32 @memcpy(i8* %7, i8* %11, i32 %12)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int strlen(char *);
uint8_t opdi_uint8_to_str(uint8_t value, char *msgBuf) {
  snprintf(msgBuf, 3, "%u", value);
  return strlen(msgBuf);
}


x86 assembly (clang, -O0):
<opdi_uint8_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x3,%esi
lea    0xebe(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opdi_uint8_to_str>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xed3(%rip),%rdx
mov    %rsi,%rdi
mov    $0x3,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @opdi_uint8_to_str(i32 %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @strlen(i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_dec_hl(void) { op_write1(0x2b); }


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

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

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

LLVM IR (-O2):
define void @op_enc_dec_hl() {
%1 = tail call i32 @op_write1(i32 43)
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_ctype_name(const char *name, char *buf,
                                       struct _Locale_name_hint *hint,
                                       int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_extract_ctype_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_Locale_extract_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_extract_ctype_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_ctype_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._Locale_name_hint*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %8
%11 = call i8* @_Locale_extract_name(i8* %9, i32* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_ctype_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
/* Variables and functions */
scalar_t__ little_endian();
scalar_t__ little_endian_union();
int test_little_endian() { return little_endian() == little_endian_union(); }


x86 assembly (clang, -O0):
<test_little_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <little_endian@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <little_endian_union@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_little_endian>:
push   %rbx
xor    %eax,%eax
call   1030 <little_endian@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <little_endian_union@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_little_endian() {
%1 = call i64 (...) @little_endian()
%2 = call i64 (...) @little_endian_union()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_little_endian() {
%1 = tail call i64 (...) @little_endian()
%2 = tail call i64 (...) @little_endian_union()
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double sin(int);
double func(double x, double v2, double Psi, double phi0) {
  return (x + v2 * sin(2 * (x - Psi)) - phi0);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @func(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %5
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = fmul double 2.000000e+00, %13
%15 = fptosi double %14 to i32
%16 = call double @sin(i32 %15)
%17 = call double @llvm.fmuladd.f64(double %10, double %16, double %9)
%18 = load double, double* %8
%19 = fsub double %17, %18
ret double %19
}

LLVM IR (-O2):
define double @func(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %2
%6 = fmul double %5, 2.000000e+00
%7 = fptosi double %6 to i32
%8 = tail call double @sin(i32 %7)
%9 = tail call double @llvm.fmuladd.f64(double %1, double %8, double %0)
%10 = fsub double %9, %3
ret double %10
}
int negate(int i) { return -i; }


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

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

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

LLVM IR (-O2):
define i32 @negate(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void printFooter(FILE *out) {
  fprintf(out, "\t0x00\n"
               "};\n"
               "\n");
}


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

x86 assembly (clang, -O2):
<printFooter>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"\090x00\0A};\0A\0A\00"
define void @printFooter(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ baz(int);
scalar_t__ foo(int);
int main() {
  int t = 0;
  int ix;
  for (ix = 0; ix != 1000; ix++)
    t += foo(ix) + baz(ix);
  return t == 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
je     117d <main+0x5d>
mov    -0xc(%rbp),%edi
call   1040 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <baz@plt>
mov    -0x18(%rbp),%rcx
add    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <foo@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1030 <baz@plt>
add    %r14d,%eax
add    %eax,%ebp
add    $0x1,%ebx
cmp    $0x3e8,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 1000
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i64 @foo(i32 %8)
%10 = load i32, i32* %3
%11 = call i64 @baz(i32 %10)
%12 = add nsw i64 %9, %11
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = add nsw i64 %14, %12
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ 0, %0 ], [ %8, %1 ]
%4 = tail call i64 @foo(i32 %2)
%5 = tail call i64 @baz(i32 %2)
%6 = add nsw i64 %5, %4
%7 = trunc i64 %6 to i32
%8 = add i32 %3, %7
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 1000
br i1 %10, label %11, label %1
11: ; preds = %1
%12 = icmp eq i32 %8, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
double genrand_int32();
double genrand_real1(void) { return genrand_int32() * (1.0 / 4294967296.0); }


x86 assembly (clang, -O0):
<genrand_real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real1>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real1() {
%1 = call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}

LLVM IR (-O2):
define double @genrand_real1() {
%1 = tail call double (...) @genrand_int32()
%2 = fmul double %1, 0x3DF0000000000000
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *);
int /*<<< orphan*/ stderr;
char *setlocale(int category, const char *locale) {
  fprintf(stderr, "setlocale not supported %d %s\n", category, locale);
  return 0;
}


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale>:
push   %rax
mov    %rsi,%rcx
mov    %edi,%edx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"setlocale not supported %d %s\0A\00"
define i8* @setlocale(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"setlocale not supported %d %s\0A\00"
define noalias i8* @setlocale(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void puts(char *s) {
  while (*s) {
    putc(*s++);
  }
  putc('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = call i32 @putc(i8 signext %10)
br label %3
12: ; preds = %3
%13 = call i32 @putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putc(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putc(i8 signext 10)
ret void
}
adrx0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<adrx0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adr1_set>:
movss  0xa98ac7,%xmm0
movslq %edi,%rax
movss  %xmm0,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @adrx0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %18
store float %16, float* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adrx0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = load float, float* inttoptr (i64 11111111 to float*)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %8
store float %7, float* %9
ret i32 undef
}
g() {}


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

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

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ tfp_printf(char *);
unsigned long strtoul(const char *str, char **endptr, int base) {
  tfp_printf("strtoul called, unimplemented!\n");
  return 0;
}


x86 assembly (clang, -O0):
<strtoul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <tfp_printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"strtoul called, unimplemented!\0A\00"
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = call i32 @tfp_printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"strtoul called, unimplemented!\0A\00"
define i64 @strtoul(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
%4 = tail call i32 @tfp_printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
int castToInt(long num) { return ((int)num); }


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

x86 assembly (clang, -O2):
<castToInt>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @castToInt(i64 %0) {
%2 = trunc i64 %0 to i32
ret i32 %2
}
void SteamAPI_ISteamGameServer_SetModDir(void *self, const char *pszModDir) {
  xlogf("%s(self = %p, pszModDir = %s)\n", __func__, self, pszModDir);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamGameServer_SetModDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamGameServer_SetModDir>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s(self = %p, pszModDir = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetModDir = [36 x i8] c"SteamAPI_ISteamGameServer_SetModDir\00"
define void @SteamAPI_ISteamGameServer_SetModDir(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 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamGameServer_SetModDir, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s(self = %p, pszModDir = %s)\0A\00"
@__func__.SteamAPI_ISteamGameServer_SetModDir = [36 x i8] c"SteamAPI_ISteamGameServer_SetModDir\00"
define void @SteamAPI_ISteamGameServer_SetModDir(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @__func__.SteamAPI_ISteamGameServer_SetModDir, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long ilongand(long x, long y) {
  x &= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ilongand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0x18,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <ilongand+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilongand>:
push   %rbx
mov    %rdi,%rbx
and    $0x18,%rbx
jne    1121 <ilongand+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @ilongand(i64 %0, i64 %1) {
%3 = and i64 %0, 24
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ __CPROVER_assume(int);
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  __CPROVER_assume(x == 1);
  if (x == 2)
    x++;
  assert(x == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1153 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
%6 = call i32 @__CPROVER_assume(i32 %5)
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %0
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CPROVER_assume(i32 0)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XReparentEvent;

/* Variables and functions */
unsigned long get_XReparentEvent_serial(void *_p) {
  return (unsigned long)((XReparentEvent *)_p)->serial;
}


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

x86 assembly (clang, -O2):
<get_XReparentEvent_serial>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XReparentEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int Dcas_init(void *self) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Dcas_init(i8* nocapture readnone %0) {
ret i32 1
}
float celsius(float fahr) { return (5.0 / 9.0) * (fahr - 32.0); }


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 3.200000e+01
%6 = fmul double 0x3FE1C71C71C71C72, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -3.200000e+01
%4 = fmul double %3, 0x3FE1C71C71C71C72
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int gcd(unsigned int, unsigned int);
int relPrime(unsigned a, unsigned b) {
  if (gcd(a, b) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<relPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
cmp    $0x1,%eax
jne    113e <relPrime+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <relPrime+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relPrime>:
push   %rax
call   1030 <gcd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @relPrime(i32 %0, i32 %1) {
%3 = tail call i32 @gcd(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *dlerror();
int /*<<< orphan*/ err(char *, char *);
bool pdlerror() {
  char *errmsg = dlerror();
  if (errmsg)
    err("dlerror: %s", errmsg);
  return errmsg != NULL;
}


x86 assembly (clang, -O0):
<pdlerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114e <pdlerror+0x2e>
mov    -0x8(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1040 <err@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdlerror>:
push   %rbx
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <pdlerror+0x1f>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <err@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"dlerror: %s\00"
define i32 @pdlerror() {
%1 = alloca i8*
%2 = call i8* (...) @dlerror()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %0
%9 = load i8*, i8** %1
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"dlerror: %s\00"
define i32 @pdlerror() {
%1 = tail call i8* (...) @dlerror()
%2 = icmp ne i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3, %0
%6 = zext i1 %2 to i32
ret i32 %6
}
int MUL_ASSIGN(int x, int y) { return x *= y; }


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

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

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

LLVM IR (-O2):
define i32 @MUL_ASSIGN(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int SIGCHLD;
int /*<<< orphan*/ WAIT_ANY;
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ assert(int);
int waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
void sigchld_handler(int signum) {
  int pid;
  while (0 && signum)
    ;
  assert(signum == SIGCHLD);
  do {
    int status;
    pid = waitpid(WAIT_ANY, &status, WNOHANG);
  } while (pid > 0);
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    113a <sigchld_handler+0x1a>
jmp    113f <sigchld_handler+0x1f>
jmp    112b <sigchld_handler+0xb>
mov    -0x4(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1158 <sigchld_handler+0x38>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x2e93(%rip),%r14
mov    0x2e9c(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    (%r15),%edx
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sigchld_handler+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIGCHLD = global i32 0
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %6, %1
br i1 false, label %6, label %7
6: ; preds = %5
br label %5
7: ; preds = %5
%8 = load i32, i32* %2
%9 = load i32, i32* @SIGCHLD
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
br label %13
13: ; preds = %17, %7
%14 = load i32, i32* @WAIT_ANY
%15 = load i32, i32* @WNOHANG
%16 = call i32 @waitpid(i32 %14, i32* %4, i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %13, label %20
20: ; preds = %17
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = load i32, i32* @SIGCHLD
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = bitcast i32* %2 to i8*
br label %8
8: ; preds = %8, %1
%9 = load i32, i32* @WAIT_ANY
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 %9, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %8, label %13
13: ; preds = %8
ret void
}
tohcol(ic) {
  if (ic <= 0)
    printf("\\h'|0'");
  else
    printf("\\h'(|\\n(%2su+|\\n(%2su)/2u'", reg(ic, 0), reg(ic - 1, 2));
}


x86 assembly (clang, -O0):
<tohcol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1148 <tohcol+0x28>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117c <tohcol+0x5c>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <reg@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <reg@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohcol>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1159 <tohcol+0x39>
mov    %edi,%ebx
xor    %esi,%esi
xor    %eax,%eax
call   1040 <reg@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
mov    %ebx,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <reg@plt>
lea    0xebb(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1167 <tohcol+0x47>
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\\h'|0'\00"
@.str.1 = [27 x i8] c"\\h'(|\\n(%2su+|\\n(%2su)/2u'\00"
define i32 @tohcol(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @reg to i32 (i32, i32, ...)*)(i32 %9, i32 0)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @reg to i32 (i32, i32, ...)*)(i32 %12, i32 2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
br label %15
15: ; preds = %8, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"\\h'|0'\00"
@.str.1 = [27 x i8] c"\\h'(|\\n(%2su+|\\n(%2su)/2u'\00"
define i32 @tohcol(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @reg to i32 (i32, i32, ...)*)(i32 %0, i32 0)
%7 = add nsw i32 %0, -1
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @reg to i32 (i32, i32, ...)*)(i32 %7, i32 2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %8)
br label %10
10: ; preds = %5, %3
ret i32 undef
}
int test_func_04(int a) { return __builtin_bswap32(a) >> 16; }


x86 assembly (clang, -O0):
<test_func_04>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bswap  %eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_04>:
mov    %edi,%eax
bswap  %eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @test_func_04(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
%5 = lshr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_func_04(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
%3 = lshr i32 %2, 16
ret i32 %3
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
u_char test_bit(u_char *_src, u_char _bit) {
  printf("(u_char)1 << _bit: %d\n", (u_char)0x01 << _bit);
  printf("src is: 0x%x\n", *_src);
  printf("(u_char)1: 0x%x\n", (u_char)0x01);
  return (u_char)(*_src & ((u_char)1 << _bit));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x1,%ebp
shl    %cl,%ebp
lea    0xeda(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
and    (%rbx),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"(u_char)1 << _bit: %d\0A\00"
@.str.1 = [14 x i8] c"src is: 0x%x\0A\00"
@.str.2 = [17 x i8] c"(u_char)1: 0x%x\0A\00"
define i32 @test_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 1)
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = and i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
@.str = [23 x i8] c"(u_char)1 << _bit: %d\0A\00"
@.str.1 = [14 x i8] c"src is: 0x%x\0A\00"
@.str.2 = [17 x i8] c"(u_char)1: 0x%x\0A\00"
define i32 @test_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 1)
%8 = load i32, i32* %0
%9 = and i32 %8, %3
ret i32 %9
}
void gtk_attach_options_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_attach_options_get_type() {
ret void
}
double areaRectangulo(double base, double altura) {
  double res;
  res = base * altura;
  return res;
}


x86 assembly (clang, -O0):
<areaRectangulo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<areaRectangulo>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @areaRectangulo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @areaRectangulo(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int addTwo(int);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  assert(addTwo(5) == 7);
  assert(addTwo(8) == 10);
  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    $0x5,%edi
call   1040 <addTwo@plt>
cmp    $0x7,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x8,%edi
call   1040 <addTwo@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <addTwo@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x8,%edi
call   1040 <addTwo@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1030 <assert@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 = call i32 @addTwo(i32 5)
%7 = icmp eq i32 %6, 7
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @addTwo(i32 8)
%11 = icmp eq i32 %10, 10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @addTwo(i32 5)
%4 = icmp eq i32 %3, 7
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @addTwo(i32 8)
%8 = icmp eq i32 %7, 10
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printversion(void) {
  printf("nalarminterface v"
         "0.1"
         " built: "
         "22:26:41"
         " "
         "Mar 18 2022"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"nalarminterface v0.1 built: 22:26:41 Mar 18 2022\0A\00"
define void @printversion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"nalarminterface v0.1 built: 22:26:41 Mar 18 2022\00"
define void @printversion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
void exit(int status) {
  syscall(SYS_exit, status);
  abort();
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1040 <syscall@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_exit
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define void @exit(i32 %0) {
%2 = load i32, i32* @SYS_exit
%3 = tail call i32 @syscall(i32 %2, i32 %0)
%4 = tail call i32 (...) @abort()
unreachable
}
void do_something_init(void) { pr_alert("%s", __func__); }


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

x86 assembly (clang, -O2):
<do_something_init>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
xor    %eax,%eax
jmp    1030 <pr_alert@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@__func__.do_something_init = [18 x i8] c"do_something_init\00"
define void @do_something_init() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_init, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@__func__.do_something_init = [18 x i8] c"do_something_init\00"
define void @do_something_init() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_alert to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.do_something_init, i64 0, i64 0))
ret void
}