xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char original[10 + 1] = "cadena";
  char copia[10 + 1];
  strcpy(copia, original);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x1a(%rbp),%rdi
lea    -0xf(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x616e65646163,%rax
mov    %rax,(%rsp)
movl   $0x0,0x7(%rsp)
lea    0xd(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.original = [11 x i8] c"cadena\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca [11 x i8]
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %2 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.original = [11 x i8] c"cadena\00\00\00\00\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void output(double x) {
  if (x < 0)
    printf("Not possible\n");
  else
    printf("%.6lf\n", x);
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113e <output+0x2e>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1151 <output+0x41>
movsd  -0x8(%rbp),%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1136 <output+0x16>
lea    0xed6(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    $0x1,%al
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Not possible\0A\00"
@.str.1 = [7 x i8] c"%.6lf\0A\00"
define void @output(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%.6lf\0A\00"
@str = [13 x i8] c"Not possible\00"
define void @output(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct xdp_md {
  int dummy;
};

/* Variables and functions */
int XDP_PASS;
__attribute__((section("prog"), used)) int xdp_foo(struct xdp_md *ctx) {
  return XDP_PASS;
}


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

x86 assembly (clang, -O2):
<xdp_foo>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.xdp_md = type { i32 }
@XDP_PASS = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_foo to i8*)], section "llvm.metadata"
define i32 @xdp_foo(%struct.xdp_md* %0) section "prog" {
%2 = alloca %struct.xdp_md*
store %struct.xdp_md* %0, %struct.xdp_md** %2
%3 = load i32, i32* @XDP_PASS
ret i32 %3
}

LLVM IR (-O2):
%struct.xdp_md = type { i32 }
@XDP_PASS = global i32 0
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.xdp_md*)* @xdp_foo to i8*)], section "llvm.metadata"
define i32 @xdp_foo(%struct.xdp_md* nocapture readnone %0) section "prog" {
%2 = load i32, i32* @XDP_PASS
ret i32 %2
}
double greater_eq(double a, double b) { return a >= b; }


x86 assembly (clang, -O0):
<greater_eq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater_eq>:
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @greater_eq(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ png_write_byte(int /*<<< orphan*/ *, unsigned char);
void png_write_bytes(FILE *fi, unsigned char *bytes, int len) {
  int t;
  for (t = 0; t < len; t++)
    png_write_byte(fi, bytes[t]);
}


x86 assembly (clang, -O0):
<png_write_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <png_write_bytes+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
call   1030 <png_write_byte@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <png_write_bytes+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<png_write_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1146 <png_write_bytes+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <png_write_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <png_write_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @png_write_bytes(i32* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @png_write_byte(i32* %0, i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int set_PWM_frequency(int pi, unsigned user_gpio, unsigned frequency) {
  return pigpio_command(pi, 7, user_gpio, frequency, 1);
}


x86 assembly (clang, -O0):
<set_PWM_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x7,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PWM_frequency>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x7,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @set_PWM_frequency(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 7, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void socketfile_unlink(void) { unlink("/tmp/jgmenu_unix_socket"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"/tmp/jgmenu_unix_socket\00"
define void @socketfile_unlink() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"/tmp/jgmenu_unix_socket\00"
define void @socketfile_unlink() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uioPrintf(char *, char *);
int TestArgs(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++)
    uioPrintf("%s\n", argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<TestArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <TestArgs+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <uioPrintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <TestArgs+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestArgs>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <TestArgs+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <uioPrintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <TestArgs+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @TestArgs(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 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @uioPrintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @TestArgs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @uioPrintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int sfa(char *p, char *q, int a) {
  return __atomic_fetch_nand(p, a, 4) + __atomic_fetch_add(q, a, 5);
}


x86 assembly (clang, -O0):
<sfa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    %cl,-0x15(%rbp)
mov    -0x15(%rbp),%cl
mov    %cl,-0x1a(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x28(%rbp),%rcx
mov    -0x1a(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x2a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x29(%rbp)
test   $0x1,%cl
mov    %al,-0x19(%rbp)
jne    1158 <sfa+0x58>
jmp    1128 <sfa+0x28>
mov    -0x29(%rbp),%al
mov    %al,-0x16(%rbp)
movsbl -0x16(%rbp),%eax
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%cl
mov    %cl,-0x17(%rbp)
mov    -0x17(%rbp),%cl
lock xadd %cl,(%rdx)
mov    %cl,-0x18(%rbp)
movsbl -0x18(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfa>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    %dl,%cl
not    %cl
lock cmpxchg %cl,(%rdi)
jne    1110 <sfa+0x10>
lock xadd %dl,(%rsi)
movsbl %al,%ecx
movsbl %dl,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sfa(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = trunc i32 %12 to i8
store i8 %13, i8* %7
%14 = load i8, i8* %7
%15 = atomicrmw nand i8* %11, i8 %14 acq_rel
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %9
%22 = atomicrmw add i8* %18, i8 %21 seq_cst
store i8 %22, i8* %10
%23 = load i8, i8* %10
%24 = sext i8 %23 to i32
%25 = add nsw i32 %17, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @sfa(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = atomicrmw nand i8* %0, i8 %4 acq_rel
%6 = sext i8 %5 to i32
%7 = atomicrmw add i8* %1, i8 %4 seq_cst
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, ...);
void test_quad(int *x, long long *llx) {
  scanf("%qd", x);
  scanf("%qd", llx);
}


x86 assembly (clang, -O0):
<test_quad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_quad>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xedf(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%qd\00"
define void @test_quad(i32* %0, i64* %1) {
%3 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
%4 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
ret void
}
OP(ed, e6) {}


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

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

LLVM IR (-O0):
define i32 @OP(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void init_no_dither(int line) { ; }


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

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

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

LLVM IR (-O2):
define void @init_no_dither(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ir_tx_set(int, int);
void ir_serial_tx_start(void) {
  ir_tx_set(1, (((int)(0.6e-3 * 36e3)) * 4));
  ir_tx_set(0, (((int)(0.6e-3 * 36e3))));
}


x86 assembly (clang, -O0):
<ir_serial_tx_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x54,%esi
call   1030 <ir_tx_set@plt>
xor    %edi,%edi
mov    $0x15,%esi
call   1030 <ir_tx_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_serial_tx_start>:
push   %rax
mov    $0x1,%edi
mov    $0x54,%esi
call   1030 <ir_tx_set@plt>
xor    %edi,%edi
mov    $0x15,%esi
pop    %rax
jmp    1030 <ir_tx_set@plt>

LLVM IR (-O0):
define void @ir_serial_tx_start() {
%1 = call i32 @ir_tx_set(i32 1, i32 84)
%2 = call i32 @ir_tx_set(i32 0, i32 21)
ret void
}

LLVM IR (-O2):
define void @ir_serial_tx_start() {
%1 = tail call i32 @ir_tx_set(i32 1, i32 84)
%2 = tail call i32 @ir_tx_set(i32 0, i32 21)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ rx_buf;

/* Variables and functions */
int /*<<< orphan*/ uart_close(int);
int uart_open();
int /*<<< orphan*/ uart_read(int, unsigned char *, int);
int main(int argc, char *argv[]) {
  int fd = uart_open();
  if (fd < 0)
    return -1;
  unsigned char rx_buf[9];
  uart_read(fd, rx_buf, sizeof(rx_buf));
  uart_close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <uart_open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <main+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <main+0x4f>
mov    -0x14(%rbp),%edi
lea    -0x1d(%rbp),%rsi
mov    $0x9,%edx
call   1030 <uart_read@plt>
mov    -0x14(%rbp),%edi
call   1040 <uart_close@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <uart_open@plt>
test   %eax,%eax
js     115f <main+0x2f>
mov    %eax,%ebp
lea    0xf(%rsp),%rsi
mov    %eax,%edi
mov    $0x9,%edx
call   1030 <uart_read@plt>
mov    %ebp,%edi
call   1040 <uart_close@plt>
jmp    1164 <main+0x34>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = tail call i32 (...) @uart_open()
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%8 = call i32 @uart_read(i32 %4, i8* %7, i32 9)
%9 = call i32 @uart_close(i32 %4)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ s2sah(int, float, float);
void s2sah_(int *fs, float *angle, float *barb) { s2sah(*fs, *angle, *barb); }


x86 assembly (clang, -O0):
<s2sah_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <s2sah@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2sah_>:
mov    (%rdi),%edi
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
jmp    1030 <s2sah@plt>

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

LLVM IR (-O2):
define void @s2sah_(i32* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load i32, i32* %0
%5 = load float, float* %1
%6 = load float, float* %2
%7 = tail call i32 @s2sah(i32 %4, float %5, float %6)
ret void
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void hide_cursor() {
  if (write(1, "\033[?25l\033[?1c", 11))
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<hide_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     1143 <hide_cursor+0x33>
jmp    1139 <hide_cursor+0x29>
jmp    113e <hide_cursor+0x2e>
jmp    1143 <hide_cursor+0x33>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[?25l\1B[?1c\00"
define void @hide_cursor() {
%1 = call i64 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[?25l\1B[?1c\00"
define void @hide_cursor() {
%1 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 11)
ret void
}
double determ(double a11, double a12, double a21, double a22) {
  return a11 * a22 - a12 * a21;
}


x86 assembly (clang, -O0):
<determ>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @determ(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* %8
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @determ(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, long);
char *long2string(long number) {
  static char string[22];
  sprintf(string, "%li", number);
  return string;
}


x86 assembly (clang, -O0):
<long2string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long2string>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@long2string.string = internal global [22 x i8] zeroinitializer
@.str = [4 x i8] c"%li\00"
define i8* @long2string(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @long2string.string, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @long2string.string, i64 0, i64 0)
}

LLVM IR (-O2):
@long2string.string = internal global [22 x i8] zeroinitializer
@.str = [4 x i8] c"%li\00"
define i8* @long2string(i64 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @long2string.string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @long2string.string, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(scalar_t__ volatile);
uint32_t TimerIntStatus(uint32_t ui32Base, bool bMasked) {
  ASSERT(_TimerBaseValid(ui32Base));
  return (bMasked ? (*((volatile uint32_t *)(ui32Base + 0x00000020)))
                  : (*((volatile uint32_t *)(ui32Base + 0x0000001C))));
}


x86 assembly (clang, -O0):
<TimerIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0xc(%rbp)
je     115a <TimerIntStatus+0x3a>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <TimerIntStatus+0x46>
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntStatus>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,0x8(%rsp)
mov    0x8(%rsp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
mov    0x8(%rsp),%rcx
mov    0x1c(%rcx,%rax,4),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @TimerIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store volatile i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load volatile i64, i64* %3
%6 = call i32 @_TimerBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load volatile i64, i64* %3
%12 = add nsw i64 %11, 32
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
br label %20
15: ; preds = %2
%16 = load volatile i64, i64* %3
%17 = add nsw i64 %16, 28
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
br label %20
20: ; preds = %15, %10
%21 = phi i64 [ %14, %10 ], [ %19, %15 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @TimerIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = load volatile i64, i64* %3
%5 = tail call i32 @_TimerBaseValid(i64 %4)
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp eq i32 %1, 0
%8 = load volatile i64, i64* %3
%9 = select i1 %7, i64 28, i64 32
%10 = add nsw i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int refc_dec(void *handle) {
  int *ptr = ((void *)(((int *)handle) - 1));
  assert(*ptr > 0);
  int ret = --*ptr;

  return ret;
}


x86 assembly (clang, -O0):
<refc_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,(%rcx)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refc_dec>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x0,-0x4(%rbx)
setg   %dil
call   1030 <assert@plt>
mov    -0x4(%rbx),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @refc_dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = bitcast i32* %7 to i8*
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
%17 = add nsw i32 %16, -1
store i32 %17, i32* %15
store i32 %17, i32* %4
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @refc_dec(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
ret i32 %9
}
/* Variables and functions */
char *emalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *dupstr(const char *s) {
  char *p;
  p = emalloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<dupstr>:
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 <emalloc@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):
<dupstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <emalloc@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* @dupstr(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* @emalloc(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* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @emalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int as_int32(unsigned int);
int as_uint32(int);
extern unsigned divide(unsigned a, unsigned b) {
  if (!b)
    return a;
  return as_uint32(as_int32(a) / as_int32(b));
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1143 <divide+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <divide+0x48>
mov    -0x8(%rbp),%edi
call   1030 <as_int32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <as_int32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <as_uint32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
test   %esi,%esi
je     114b <divide+0x2b>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <as_int32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <as_int32@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <as_uint32@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @divide(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* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @as_int32(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @as_int32(i32 %13)
%15 = sdiv i32 %12, %14
%16 = call i32 @as_uint32(i32 %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %10, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @as_int32(i32 %0)
%6 = tail call i32 @as_int32(i32 %1)
%7 = sdiv i32 %5, %6
%8 = tail call i32 @as_uint32(i32 %7)
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ %0, %2 ]
ret i32 %10
}
unsigned long posUnsignedLongExtract(unsigned char *inbuf) {
  return ((unsigned long)((((inbuf[3]) << 24) & 0xFF000000) |
                          (((inbuf[2]) << 16) & 0x00FF0000) |
                          (((inbuf[1]) << 8) & 0x0000FF00) |
                          ((inbuf[0]) & 0x000000FF)));
}


x86 assembly (clang, -O0):
<posUnsignedLongExtract>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posUnsignedLongExtract>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @posUnsignedLongExtract(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = and i32 %7, -16777216
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = and i32 %13, 16711680
%15 = or i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = and i32 %20, 65280
%22 = or i32 %15, %21
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, 255
%28 = or i32 %22, %27
%29 = zext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @posUnsignedLongExtract(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = shl nuw nsw i64 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i64
%9 = shl nuw nsw i64 %8, 16
%10 = or i64 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = or i64 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int str_len(char *);
int get_dot(char *value) {
  int dot = str_len(value), i = 0;
  while ((value[i] != '.') && (i < dot)) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_len@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x11(%rbp)
je     1155 <get_dot+0x45>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1165 <get_dot+0x55>
jmp    1173 <get_dot+0x63>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <get_dot+0x1f>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dot>:
push   %rbx
mov    %rdi,%rbx
call   1030 <str_len@plt>
movslq %eax,%rcx
xor    %edx,%edx
xchg   %ax,%ax
lea    0x1(%rdx),%rax
cmpb   $0x2e,(%rbx,%rdx,1)
je     1132 <get_dot+0x22>
cmp    %rcx,%rdx
mov    %rax,%rdx
jl     1120 <get_dot+0x10>
add    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_dot(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @str_len(i8* %5)
store i32 %6, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %21, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 46
br i1 %14, label %15, label %19
15: ; preds = %7
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br label %19
19: ; preds = %15, %7
%20 = phi i1 [ false, %7 ], [ %18, %15 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %7
24: ; preds = %19
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @get_dot(i8* %0) {
%2 = tail call i32 @str_len(i8* %0)
%3 = sext i32 %2 to i64
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 46
%9 = icmp slt i64 %5, %3
%10 = select i1 %8, i1 %9, i1 false
%11 = add nuw nsw i64 %5, 1
br i1 %10, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %5 to i32
ret i32 %13
}
__attribute__((no, noclone)) unsigned __int128 t150_4add(unsigned __int128 x) {
  unsigned __int128 y = (3);
  unsigned __int128 r;
  if (__builtin_add_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t150_4add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x3,-0x40(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rax
add    %rsi,%rdx
adc    %rax,%rcx
setb   %al
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x48(%rbp)
test   $0x1,%al
jne    116e <t150_4add+0x5e>
jmp    1175 <t150_4add+0x65>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t150_4add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x3,%rbx
adc    $0x0,%r14
jae    112b <t150_4add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t150_4add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 3, i128* %6
%12 = load i128, i128* %5
%13 = load i128, i128* %6
%14 = call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
store i128 %16, i128* %7
br i1 %15, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %7
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t150_4add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.uadd.with.overflow.i128(i128 %6, i128 3)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int func2(int, int);
int main(void) { return (func2(5, 6)); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x6,%esi
jmp    1030 <func2@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func2(i32 5, i32 6)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func2(i32 5, i32 6)
ret i32 %1
}
void TwInit(void) {
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 16)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x14))) = ((1 << 17)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x34))) = ((1 << 16)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x34))) = ((1 << 17)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x00))) = ((1 << 16)));
  (*((volatile unsigned int *)((0xFFFF0000 + 0x00))) = ((1 << 17)));
}


x86 assembly (clang, -O0):
<TwInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffff0014,%eax
movl   $0x10000,(%rax)
mov    $0xffff0014,%eax
movl   $0x20000,(%rax)
mov    $0xffff0034,%eax
movl   $0x10000,(%rax)
mov    $0xffff0034,%eax
movl   $0x20000,(%rax)
mov    $0xffff0000,%eax
movl   $0x10000,(%rax)
mov    $0xffff0000,%eax
movl   $0x20000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TwInit>:
mov    $0xffff0000,%eax
movl   $0x10000,0x14(%rax)
movl   $0x20000,0x14(%rax)
movl   $0x10000,0x34(%rax)
movl   $0x20000,0x34(%rax)
movl   $0x10000,(%rax)
movl   $0x20000,(%rax)
ret

LLVM IR (-O0):
define void @TwInit() {
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901812 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901812 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901760 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901760 to i32*)
ret void
}

LLVM IR (-O2):
define void @TwInit() {
store volatile i32 65536, i32* inttoptr (i64 4294901780 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901780 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901812 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901812 to i32*)
store volatile i32 65536, i32* inttoptr (i64 4294901760 to i32*)
store volatile i32 131072, i32* inttoptr (i64 4294901760 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *memset(void *, int, size_t);
void *Memset(void *s, int c, size_t n) {
  assert(s != NULL);
  assert(n > 0);
  return memset(s, c, n);
}


x86 assembly (clang, -O0):
<Memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Memset>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @Memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %6
%12 = icmp ugt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = trunc i32 %16 to i8
%18 = load i64, i64* %6
ret i8* %15
}

LLVM IR (-O2):
define i8* @Memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i64 %2, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %10, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\nHello code!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"\0AHello code!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0AHello code!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t s291_get_dc(const uint16_t *p_s291) { return p_s291[5] & 0xff; }


x86 assembly (clang, -O0):
<s291_get_dc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s291_get_dc>:
movzbl 0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @s291_get_dc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @s291_get_dc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int iswdigit(wint_t c) { return (unsigned int)(c - '0') < 10u; }


x86 assembly (clang, -O0):
<iswdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x30,%rax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @iswdigit(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 48
%5 = trunc i64 %4 to i32
%6 = icmp ult i32 %5, 10
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @iswdigit(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getdtablesize(void) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<getdtablesize>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtablesize>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getdtablesize() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getdtablesize() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}