xunge/DecIR huggingface dataset:
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int index;
  if (s) {
    index = 0;
    while (s[index] != '\0') {
      f(index, &s[index]);
      index++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <ft_striteri+0x5c>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_striteri+0x57>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <ft_striteri+0x22>
jmp    115c <ft_striteri+0x5c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1133 <ft_striteri+0x33>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
xor    %ebx,%ebx
mov    %r15,%rsi
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i8* [ %12, %7 ], [ %0, %4 ]
%9 = phi i32 [ %10, %7 ], [ 0, %4 ]
tail call void %1(i32 %9, i8* %8)
%10 = add i32 %9, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %4, %2
ret void
}
int netopen(path)
char *path;
{
  internal_error("network operations not supported");
  return -1;
}


x86 assembly (clang, -O0):
<netopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <internal_error@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"network operations not supported\00"
define i32 @netopen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @internal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [33 x i8] c"network operations not supported\00"
define i32 @netopen(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @internal_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
void fiat_secp256k1_mulx_u32(uint32_t *out1, uint32_t *out2, uint32_t arg1,
                             uint32_t arg2) {
  uint64_t x1;
  uint32_t x2;
  uint32_t x3;
  x1 = ((uint64_t)arg1 * arg2);
  x2 = (uint32_t)(x1 & UINT32_C(0xffffffff));
  x3 = (uint32_t)(x1 >> 32);
  *out1 = x2;
  *out2 = x3;
}


x86 assembly (clang, -O0):
<fiat_secp256k1_mulx_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_secp256k1_mulx_u32>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
imul   %ecx,%ebx
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fiat_secp256k1_mulx_u32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = call i32 @UINT32_C(i32 -1)
%17 = and i32 %15, %16
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = ashr i32 %18, 32
store i32 %19, i32* %11
%20 = load i32, i32* %10
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32, i32* %11
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_mulx_u32(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = tail call i32 @UINT32_C(i32 -1)
%7 = and i32 %6, %5
store i32 %7, i32* %0
ret void
}
void I2CSlaveIntEnableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) |= ulIntFlags;
}


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

x86 assembly (clang, -O2):
<I2CSlaveIntEnableEx>:
or     %rsi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 12
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnableEx(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
int test2(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @test2(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Again(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ Then(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void Repeat(FILE *fc, FILE *fh) {
  Again(fc, fh);
  Then(fc, fh);
}


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

x86 assembly (clang, -O2):
<Repeat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <Again@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <Then@plt>

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

LLVM IR (-O2):
define void @Repeat(i32* %0, i32* %1) {
%3 = tail call i32 @Again(i32* %0, i32* %1)
%4 = tail call i32 @Then(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
void test2(int argc, char **argv) {
  puts("test2: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
  fputs("test222222222222222222\n", stdout);
  fputs("argc %d; argv %p\n", stdout);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
lea    0xee2(%rip),%rdi
call   1040 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rbx
mov    (%rbx),%esi
lea    0xeed(%rip),%rdi
call   1040 <fputs@plt>
mov    (%rbx),%esi
lea    0xef7(%rip),%rdi
pop    %rbx
jmp    1040 <fputs@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"test2: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00"
@.str.1 = [24 x i8] c"test222222222222222222\0A\00"
@stdout = global i32 0
@.str.2 = [18 x i8] c"argc %d; argv %p\0A\00"
define void @test2(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"test2: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00"
@.str.1 = [24 x i8] c"test222222222222222222\0A\00"
@stdout = global i32 0
@.str.2 = [18 x i8] c"argc %d; argv %p\0A\00"
define void @test2(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ urandom_get(size_t *, int);
size_t urandom_size_t() {
  size_t result;
  urandom_get(&result, sizeof(result));
  return result;
}


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

x86 assembly (clang, -O2):
<urandom_size_t>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <urandom_get@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @urandom_size_t() {
%1 = alloca i64
%2 = call i32 @urandom_get(i64* %1, i32 8)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @urandom_size_t() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @urandom_get(i64* %1, i32 8)
%4 = load i64, i64* %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ WStoSPI(int /*<<< orphan*/ *, int /*<<< orphan*/);
void WSGtoSPI(uint8_t *pi8SPIData, uint8_t ui8Color) {
  WStoSPI(pi8SPIData + (8 * 0), ui8Color);
}


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

x86 assembly (clang, -O2):
<WSGtoSPI>:
jmp    1030 <WStoSPI@plt>

LLVM IR (-O0):
define void @WSGtoSPI(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %4
%8 = call i32 @WStoSPI(i32* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @WSGtoSPI(i32* %0, i32 %1) {
%3 = tail call i32 @WStoSPI(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interface_cleanup();
int /*<<< orphan*/ interface_closeLibrary();
int /*<<< orphan*/ interface_closeServer();
void cleanup() {
  interface_closeServer();
  interface_cleanup();
  interface_closeLibrary();
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <interface_closeServer@plt>
mov    $0x0,%al
call   1050 <interface_cleanup@plt>
mov    $0x0,%al
call   1040 <interface_closeLibrary@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <interface_closeServer@plt>
xor    %eax,%eax
call   1050 <interface_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <interface_closeLibrary@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 (...) @interface_closeServer()
%2 = call i32 (...) @interface_cleanup()
%3 = call i32 (...) @interface_closeLibrary()
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @interface_closeServer()
%2 = tail call i32 (...) @interface_cleanup()
%3 = tail call i32 (...) @interface_closeLibrary()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNd_identity(double *, int);
void mat3d_identity(double m[9]) { matNd_identity(m, 3); }


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

x86 assembly (clang, -O2):
<mat3d_identity>:
mov    $0x3,%esi
jmp    1030 <matNd_identity@plt>

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

LLVM IR (-O2):
define void @mat3d_identity(double* %0) {
%2 = tail call i32 @matNd_identity(double* %0, i32 3)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int UINT32_C(int);
void fiat_p224_mulx_u32(uint32_t *out1, uint32_t *out2, uint32_t arg1,
                        uint32_t arg2) {
  uint64_t x1;
  uint32_t x2;
  uint32_t x3;
  x1 = ((uint64_t)arg1 * arg2);
  x2 = (uint32_t)(x1 & UINT32_C(0xffffffff));
  x3 = (uint32_t)(x1 >> 32);
  *out1 = x2;
  *out2 = x3;
}


x86 assembly (clang, -O0):
<fiat_p224_mulx_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p224_mulx_u32>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
imul   %ecx,%ebx
mov    $0xffffffff,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fiat_p224_mulx_u32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = call i32 @UINT32_C(i32 -1)
%17 = and i32 %15, %16
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = ashr i32 %18, 32
store i32 %19, i32* %11
%20 = load i32, i32* %10
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32, i32* %11
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @fiat_p224_mulx_u32(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = tail call i32 @UINT32_C(i32 -1)
%7 = and i32 %6, %5
store i32 %7, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_clock();
int /*<<< orphan*/ setup_pieces();
int /*<<< orphan*/ setup_sym_set();
int /*<<< orphan*/ setup_symmetries();
int /*<<< orphan*/ setup_vec();
void setup(void) {
  setup_clock();
  setup_vec();
  setup_symmetries();
  setup_sym_set();
  setup_pieces();
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <setup_clock@plt>
mov    $0x0,%al
call   1070 <setup_vec@plt>
mov    $0x0,%al
call   1030 <setup_symmetries@plt>
mov    $0x0,%al
call   1060 <setup_sym_set@plt>
mov    $0x0,%al
call   1040 <setup_pieces@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %eax,%eax
call   1050 <setup_clock@plt>
xor    %eax,%eax
call   1070 <setup_vec@plt>
xor    %eax,%eax
call   1030 <setup_symmetries@plt>
xor    %eax,%eax
call   1060 <setup_sym_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <setup_pieces@plt>

LLVM IR (-O0):
define void @setup() {
%1 = call i32 (...) @setup_clock()
%2 = call i32 (...) @setup_vec()
%3 = call i32 (...) @setup_symmetries()
%4 = call i32 (...) @setup_sym_set()
%5 = call i32 (...) @setup_pieces()
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @setup_clock()
%2 = tail call i32 (...) @setup_vec()
%3 = tail call i32 (...) @setup_symmetries()
%4 = tail call i32 (...) @setup_sym_set()
%5 = tail call i32 (...) @setup_pieces()
ret void
}
int main() {
  int k = 0;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      k = k + i;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    115e <main+0x5e>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    114b <main+0x4b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <main+0x2a>
jmp    1150 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 450
}
void gtk_text_iter_backward_search() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_search() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ pipe(int *);
int main(void) {
  int fd[2];
  assert(!pipe(fd));
  assert(fd[0] == 3);
  assert(fd[1] == 4);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <pipe@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x3,(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpl   $0x4,0x4(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 3
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 4
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ reset_tty();
void keyboard_quit(int sig) {
  reset_tty();
  fatal("received quit signal, exiting");
}


x86 assembly (clang, -O0):
<keyboard_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <reset_tty@plt>
lea    0xec7(%rip),%rdi
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_quit>:
push   %rax
xor    %eax,%eax
call   1030 <reset_tty@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <fatal@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"received quit signal, exiting\00"
define void @keyboard_quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @reset_tty()
%4 = call i32 @fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"received quit signal, exiting\00"
define void @keyboard_quit(i32 %0) {
%2 = tail call i32 (...) @reset_tty()
%3 = tail call i32 @fatal(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 36 + 70 + 748 + 20259 + 11);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 21124)
ret i32 0
}
unsigned int _unpklu4(unsigned int src1) {
  unsigned v1 = (src1 >> 8) & 0xff;
  unsigned v0 = (src1)&0xff;
  return (v1 << 16) | v0;
}


x86 assembly (clang, -O0):
<_unpklu4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unpklu4>:
movzbl %dil,%eax
shl    $0x8,%edi
and    $0xff0000,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @_unpklu4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 255
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 255
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = shl i32 %10, 16
%12 = load i32, i32* %4
%13 = or i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @_unpklu4(i32 %0) {
%2 = and i32 %0, 255
%3 = shl i32 %0, 8
%4 = and i32 %3, 16711680
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo();
main() {
  if (foo() != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1147 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
test   %rax,%rax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @foo()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @foo()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int init_file(char *file) {
  FILE *fp;
  if ((fp = fopen(file, "w")) == NULL) {
    printf("Can't open %s\n", file);
    exit(1);
  }
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<init_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1184 <init_file+0x44>
mov    -0x8(%rbp),%rsi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_file>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1161 <init_file+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe9a(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [15 x i8] c"Can't open %s\0A\00"
define i32 @init_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i32 @fclose(i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [15 x i8] c"Can't open %s\0A\00"
define i32 @init_file(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void left(int n) { printf("%c[%dD", 0x1B, n); }


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dD\00"
define void @left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dD\00"
define void @left(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
double sq(double v) { return v * v; }


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

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

LLVM IR (-O0):
define double @sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void foo(int n) { n; }


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
char const *
_Locale_compose_name(char *__DUMMY_PAR1, const char *__DUMMY_PAR2,
                     const char *__DUMMY_PAR3, const char *__DUMMY_PAR4,
                     const char *__DUMMY_PAR5, const char *__DUMMY_PAR6,
                     const char *__DUMMY_PAR7, const char *__DUMMY_PAR8) {
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @_Locale_compose_name(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_Locale_compose_name(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7) {
ret i8* null
}
void swap(void *data) {
  char tmp[4];
  tmp[0] = ((char *)data)[0];
  tmp[1] = ((char *)data)[1];
  tmp[2] = ((char *)data)[2];
  tmp[3] = ((char *)data)[3];
  ((char *)data)[0] = tmp[3];
  ((char *)data)[1] = tmp[2];
  ((char *)data)[2] = tmp[1];
  ((char *)data)[3] = tmp[0];
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%sil
mov    0x1(%rdi),%cl
mov    0x2(%rdi),%dl
mov    0x3(%rdi),%al
mov    %al,(%rdi)
mov    %dl,0x1(%rdi)
mov    %cl,0x2(%rdi)
mov    %sil,0x3(%rdi)
ret

LLVM IR (-O0):
define void @swap(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%21 = load i8, i8* %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%25 = load i8, i8* %24
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 1
store i8 %25, i8* %27
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%29 = load i8, i8* %28
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 2
store i8 %29, i8* %31
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%33 = load i8, i8* %32
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 3
store i8 %33, i8* %35
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* %0
store i8 %6, i8* %3
store i8 %4, i8* %5
store i8 %2, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void sika_log(const char *level, const char *message) {
  printf("%s - %s", level, message);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s - %s\00"
define void @sika_log(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 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s - %s\00"
define void @sika_log(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void gtk_window_set_geometry_hints() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_geometry_hints() {
ret void
}
/* Variables and functions */
int stub1(int);
int tputs(const char *cp, int affcnt, int (*outc)(int ch)) {
  if (cp == (char *)NULL)
    return (1);
  while (*cp)
    (*outc)(*cp++);
  return (1);
}


x86 assembly (clang, -O0):
<tputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112a <tputs+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1160 <tputs+0x60>
jmp    112f <tputs+0x2f>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1159 <tputs+0x59>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%edi
call   *%rax
jmp    112f <tputs+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tputs>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1131 <tputs+0x31>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1131 <tputs+0x31>
mov    %rdx,%r14
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edi
call   *%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tputs+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @tputs(i8* %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %5, %8
%9 = phi i8 [ %14, %8 ], [ %6, %5 ]
%10 = phi i8* [ %11, %8 ], [ %0, %5 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = sext i8 %9 to i32
%13 = tail call i32 %2(i32 %12)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %5, %3
ret i32 1
}
int parse_text(const char *text) {
  int len = 0;
  while (text[len] && text[len] != 0x1b)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<parse_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     113e <parse_text+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1b,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <parse_text+0x4e>
jmp    115c <parse_text+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <parse_text+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_text>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <parse_text+0x23>
cmp    $0x1b,%cl
je     1123 <parse_text+0x23>
add    $0x1,%rax
jmp    1110 <parse_text+0x10>
ret

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

LLVM IR (-O2):
define i32 @parse_text(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 27, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int test1(void) { return *(volatile int *)0x1234; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
mov    0x1234,%eax
ret

LLVM IR (-O0):
define i32 @test1() {
%1 = load volatile i32, i32* inttoptr (i64 4660 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test1() {
%1 = load volatile i32, i32* inttoptr (i64 4660 to i32*)
ret i32 %1
}
void asignar(int a) { a = 3; }


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

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

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

LLVM IR (-O2):
define void @asignar(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ carthw_Xin1_write8(int, int /*<<< orphan*/);
void carthw_Xin1_reset(void) { carthw_Xin1_write8(0xa13000, 0); }


x86 assembly (clang, -O0):
<carthw_Xin1_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa13000,%edi
xor    %esi,%esi
call   1030 <carthw_Xin1_write8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<carthw_Xin1_reset>:
mov    $0xa13000,%edi
xor    %esi,%esi
jmp    1030 <carthw_Xin1_write8@plt>

LLVM IR (-O0):
define void @carthw_Xin1_reset() {
%1 = call i32 @carthw_Xin1_write8(i32 10563584, i32 0)
ret void
}

LLVM IR (-O2):
define void @carthw_Xin1_reset() {
%1 = tail call i32 @carthw_Xin1_write8(i32 10563584, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int r_utils_dec_to_hexchar(int c) {
  assert(c >= 0 && c < 16);
  return "0123456789abcdef"[c];
}


x86 assembly (clang, -O0):
<r_utils_dec_to_hexchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <r_utils_dec_to_hexchar+0x24>
cmpl   $0x10,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rcx
lea    0xeb4(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_utils_dec_to_hexchar>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10,%ebx
setb   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
lea    0xed5(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @r_utils_dec_to_hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 16
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define i32 @r_utils_dec_to_hexchar(i32 %0) {
%2 = icmp ult i32 %0, 16
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}
void sgx_ecall() {}


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

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

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

LLVM IR (-O2):
define void @sgx_ecall() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void delay_ms(uint32_t nTime) {
  volatile uint32_t counter = nTime * 4000;
  while (counter--)
    ;
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xfa0,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     112a <delay_ms+0x2a>
jmp    1111 <delay_ms+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
imul   $0xfa0,%edi,%eax
mov    %eax,-0x4(%rsp)
nopw   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <delay_ms+0x10>
ret

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4000
store volatile i32 %5, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load volatile i32, i32* %3
%8 = add nsw i32 %7, -1
store volatile i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = mul nsw i32 %0, 4000
store volatile i32 %4, i32* %2
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %2
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %5
9: ; preds = %5
ret void
}
void CL_Snd_Restart(void) {}


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

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

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

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