xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
in_addr_t netmask(int prefix) {
  return prefix == 0 ? 0 : ~(in_addr_t)0 << (32 - prefix);
}


x86 assembly (clang, -O0):
<netmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <netmask+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <netmask+0x2d>
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%eax
shl    %cl,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @netmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 32, %7
%9 = shl i32 -1, %8
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ 0, %5 ], [ %9, %6 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @netmask(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = sub nsw i32 32, %0
%4 = shl nsw i32 -1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int token(char *);
int method(char *s) { return token(s); }


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

x86 assembly (clang, -O2):
<method>:
jmp    1030 <token@plt>

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

LLVM IR (-O2):
define i32 @method(i8* %0) {
%2 = tail call i32 @token(i8* %0)
ret i32 %2
}
/* Variables and functions */
void *calloc(int, int);
scalar_t__ flushentry();
void *Calloc(int cnt, int size) {
  void *retval;
  while ((retval = calloc(cnt, size)) == NULL)
    if (flushentry() == 0)
      break;
  return (retval);
}


x86 assembly (clang, -O0):
<Calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1162 <Calloc+0x42>
mov    $0x0,%al
call   1040 <flushentry@plt>
cmp    $0x0,%rax
jne    115d <Calloc+0x3d>
jmp    1162 <Calloc+0x42>
jmp    112e <Calloc+0xe>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114e <Calloc+0x2e>
xor    %eax,%eax
call   1040 <flushentry@plt>
test   %rax,%rax
jne    1130 <Calloc+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define noalias i8* @Calloc(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i8* @calloc(i32 %0, i32 %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 (...) @flushentry()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %6, %3
ret i8* %4
}
int functionc(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<functionc>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @functionc(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @functionc(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s\n", "Hello World!!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [14 x i8] c"Hello World!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_95int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x95 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_95int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9764864
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ I2C_Init();
int /*<<< orphan*/ I2C_SetSpeed(int);
void MCP23018_Init() {
  I2C_Init();
  I2C_SetSpeed(2);
}


x86 assembly (clang, -O0):
<MCP23018_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <I2C_Init@plt>
mov    $0x2,%edi
call   1040 <I2C_SetSpeed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCP23018_Init>:
push   %rax
xor    %eax,%eax
call   1030 <I2C_Init@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <I2C_SetSpeed@plt>

LLVM IR (-O0):
define void @MCP23018_Init() {
%1 = call i32 (...) @I2C_Init()
%2 = call i32 @I2C_SetSpeed(i32 2)
ret void
}

LLVM IR (-O2):
define void @MCP23018_Init() {
%1 = tail call i32 (...) @I2C_Init()
%2 = tail call i32 @I2C_SetSpeed(i32 2)
ret void
}
/* Type definitions */
struct xattr_list {
  int dummy;
};

/* Variables and functions */
struct xattr_list *get_xattr(int i, unsigned int *count) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.xattr_list = type { i32 }
define %struct.xattr_list* @get_xattr(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
ret %struct.xattr_list* null
}

LLVM IR (-O2):
%struct.xattr_list = type { i32 }
define noalias %struct.xattr_list* @get_xattr(i32 %0, i32* nocapture readnone %1) {
ret %struct.xattr_list* null
}
/* Variables and functions */
int /*<<< orphan*/ flush(void *);
int /*<<< orphan*/ maccess(void *);
size_t rdtsc();
size_t flushandreload(void *addr, void *addr2) {
  flush(addr2);
  maccess(addr2);
  flush(addr2);
  flush(addr);
  maccess(addr2);
  size_t time = rdtsc();
  maccess(addr);
  size_t delta = rdtsc() - time;
  flush(addr);
  return delta;
}


x86 assembly (clang, -O0):
<flushandreload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <flush@plt>
mov    -0x10(%rbp),%rdi
call   1050 <maccess@plt>
mov    -0x10(%rbp),%rdi
call   1030 <flush@plt>
mov    -0x8(%rbp),%rdi
call   1030 <flush@plt>
mov    -0x10(%rbp),%rdi
call   1050 <maccess@plt>
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <maccess@plt>
mov    $0x0,%al
call   1040 <rdtsc@plt>
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <flush@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flushandreload>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <flush@plt>
mov    %rbx,%rdi
call   1050 <maccess@plt>
mov    %rbx,%rdi
call   1030 <flush@plt>
mov    %r14,%rdi
call   1030 <flush@plt>
mov    %rbx,%rdi
call   1050 <maccess@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <maccess@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
sub    %r15,%rbx
mov    %r14,%rdi
call   1030 <flush@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @flushandreload(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @flush(i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @maccess(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @flush(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @flush(i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @maccess(i8* %15)
%17 = call i64 (...) @rdtsc()
store i64 %17, i64* %5
%18 = load i8*, i8** %3
%19 = call i32 @maccess(i8* %18)
%20 = call i64 (...) @rdtsc()
%21 = load i64, i64* %5
%22 = sub i64 %20, %21
store i64 %22, i64* %6
%23 = load i8*, i8** %3
%24 = call i32 @flush(i8* %23)
%25 = load i64, i64* %6
ret i64 %25
}

LLVM IR (-O2):
define i64 @flushandreload(i8* %0, i8* %1) {
%3 = tail call i32 @flush(i8* %1)
%4 = tail call i32 @maccess(i8* %1)
%5 = tail call i32 @flush(i8* %1)
%6 = tail call i32 @flush(i8* %0)
%7 = tail call i32 @maccess(i8* %1)
%8 = tail call i64 (...) @rdtsc()
%9 = tail call i32 @maccess(i8* %0)
%10 = tail call i64 (...) @rdtsc()
%11 = sub i64 %10, %8
%12 = tail call i32 @flush(i8* %0)
ret i64 %11
}
int fi3(int j, signed short *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fi3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movswl (%rcx,%rdx,2),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi3>:
movslq %edx,%rax
movswl (%rsi,%rax,2),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fi3(i32 %0, i16* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i32
store i32 %0, i32* %4
store i16* %1, i16** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i16*, i16** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i16, i16* %8, i64 %10
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
%14 = add nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fi3(i32 %0, i16* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i16, i16* %1, i64 %4
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int read_char_direct();
int serial_getc(void) { return read_char_direct(); }


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

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

LLVM IR (-O0):
define i32 @serial_getc() {
%1 = call i32 (...) @read_char_direct()
ret i32 %1
}

LLVM IR (-O2):
define i32 @serial_getc() {
%1 = tail call i32 (...) @read_char_direct()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ FX_StopSound(int);
int /*<<< orphan*/ PCFX_Stop(int);
void SFX_StopPatch(int handle) {
  if (handle & 0x8000) {
    PCFX_Stop(handle & 0x7fff);
    return;
  }
  FX_StopSound(handle);
}


x86 assembly (clang, -O0):
<SFX_StopPatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     114f <SFX_StopPatch+0x2f>
mov    -0x4(%rbp),%edi
and    $0x7fff,%edi
call   1040 <PCFX_Stop@plt>
jmp    1157 <SFX_StopPatch+0x37>
mov    -0x4(%rbp),%edi
call   1030 <FX_StopSound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SFX_StopPatch>:
test   $0x8000,%edi
jne    112d <SFX_StopPatch+0xd>
jmp    1030 <FX_StopSound@plt>
and    $0x7fff,%edi
jmp    1040 <PCFX_Stop@plt>

LLVM IR (-O0):
define void @SFX_StopPatch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 32767
%9 = call i32 @PCFX_Stop(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @FX_StopSound(i32 %11)
br label %13
13: ; preds = %10, %6
ret void
}

LLVM IR (-O2):
define void @SFX_StopPatch(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = and i32 %0, 32767
%6 = tail call i32 @PCFX_Stop(i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i32 @FX_StopSound(i32 %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __expl(long double x) {
  fputs("__expl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__expl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__expl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"__expl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__expl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [24 x i8] c"__expl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__expl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
int Operand_soffset_encode(unsigned int *valp) {
  unsigned offset_0, soffset_0;
  soffset_0 = *valp;
  offset_0 = (soffset_0 - 0x4) & 0x3ffff;
  *valp = offset_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_soffset_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
and    $0x3ffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_soffset_encode>:
mov    $0x3fffc,%eax
add    (%rdi),%eax
and    $0x3ffff,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_soffset_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 %7, 4
%9 = and i32 %8, 262143
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_soffset_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 262140
%4 = and i32 %3, 262143
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
char *BN_bn2hex(int /*<<< orphan*/ *);
int /*<<< orphan*/ OPENSSL_free(char *);
int /*<<< orphan*/ printf(char *, char const *, char *);
void BN_out(BIGNUM *bn, const char *n) {
  char *buf = BN_bn2hex(bn);
  printf("%s = %s\n", n, buf);
  OPENSSL_free(buf);
}


x86 assembly (clang, -O0):
<BN_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BN_bn2hex@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <OPENSSL_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_out>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <BN_bn2hex@plt>
mov    %rax,%rbx
lea    0xeba(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <OPENSSL_free@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @BN_out(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i8* @BN_bn2hex(i32* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @OPENSSL_free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s = %s\0A\00"
define void @BN_out(i32* %0, i8* %1) {
%3 = tail call i8* @BN_bn2hex(i32* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = tail call i32 @OPENSSL_free(i8* %3)
ret void
}
/* Variables and functions */
int lexicographic_sort(char const *, char const *);
int strlen(char const *);
int sort_by_length(const char *a, const char *b) {
  int res = strlen(a) - strlen(b);
  return res ? res : lexicographic_sort(a, b);
}


x86 assembly (clang, -O0):
<sort_by_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1164 <sort_by_length+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1174 <sort_by_length+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <lexicographic_sort@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_by_length>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
je     1144 <sort_by_length+0x24>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <lexicographic_sort@plt>

LLVM IR (-O0):
define i32 @sort_by_length(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %19
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @lexicographic_sort(i8* %16, i8* %17)
br label %19
19: ; preds = %15, %13
%20 = phi i32 [ %14, %13 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @sort_by_length(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sub nsw i32 %3, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @lexicographic_sort(i8* %0, i8* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ TxPIDSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void TxPIDSettingsUpdated() { UAVObjUpdated(TxPIDSettingsHandle()); }


x86 assembly (clang, -O0):
<TxPIDSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TxPIDSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @TxPIDSettingsUpdated() {
%1 = call i32 (...) @TxPIDSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TxPIDSettingsUpdated() {
%1 = tail call i32 (...) @TxPIDSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
char get_char_comp(char c) {
  int i = c - 65;
  if (i < 0 || i > 57) {
    return c;
  } else {
    return "TVGHEFCDIJMLKNOPQYWAABSXRZ[\\]^_`tvghefcdijmlknopqywaabsxrz"[i];
  }
}


x86 assembly (clang, -O0):
<get_char_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1128 <get_char_comp+0x28>
cmpl   $0x39,-0x8(%rbp)
jle    1133 <get_char_comp+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1144 <get_char_comp+0x44>
movslq -0x8(%rbp),%rcx
lea    0xec2(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char_comp>:
mov    %edi,%eax
lea    -0x7b(%rax),%ecx
cmp    $0xc6,%cl
jb     1118 <get_char_comp+0x18>
movzbl %al,%eax
lea    0xeec(%rip),%rcx
mov    -0x41(%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@.str = [59 x i8] c"TVGHEFCDIJMLKNOPQYWAABSXRZ[\\]^_`tvghefcdijmlknopqywaabsxrz\00"
define signext i8 @get_char_comp(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 65
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 57
br i1 %12, label %13, label %15
13: ; preds = %10, %1
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %20
15: ; preds = %10
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [59 x i8], [59 x i8]* @.str, i64 0, i64 %17
%19 = load i8, i8* %18
store i8 %19, i8* %2
br label %20
20: ; preds = %15, %13
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
@.str = [59 x i8] c"TVGHEFCDIJMLKNOPQYWAABSXRZ[\\]^_`tvghefcdijmlknopqywaabsxrz\00"
define signext i8 @get_char_comp(i8 signext %0) {
%2 = add i8 %0, -123
%3 = icmp ult i8 %2, -58
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = zext i8 %0 to i64
%6 = add nsw i64 %5, -65
%7 = getelementptr inbounds [59 x i8], [59 x i8]* @.str, i64 0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %1, %4
%10 = phi i8 [ %8, %4 ], [ %0, %1 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ fill(int, int, int *);
void get_cc_cap(int nw, int nfrags, int *cap) { fill(nw, nfrags, cap); }


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

x86 assembly (clang, -O2):
<get_cc_cap>:
jmp    1030 <fill@plt>

LLVM IR (-O0):
define void @get_cc_cap(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 @fill(i32 %7, i32 %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @get_cc_cap(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @fill(i32 %0, i32 %1, i32* %2)
ret void
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int O_SYNC;
int errno;
int open(char const *, int);
int /*<<< orphan*/ printf(char *, int);
int serial_open(const char *name) {
  int fd = open(name, O_RDWR | O_NOCTTY | O_SYNC);
  if (fd < 0) {
    printf("error %d setting term attributes", errno);
  }
  return fd;
}


x86 assembly (clang, -O0):
<serial_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
or     (%rax),%esi
mov    0x2e97(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1172 <serial_open+0x52>
mov    0x2e64(%rip),%rax
mov    (%rax),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_open>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ea6(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115c <serial_open+0x3c>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_SYNC = global i32 0
@.str = [33 x i8] c"error %d setting term attributes\00"
@errno = global i32 0
define i32 @serial_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NOCTTY
%7 = or i32 %5, %6
%8 = load i32, i32* @O_SYNC
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* @errno
%15 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_SYNC = global i32 0
@.str = [33 x i8] c"error %d setting term attributes\00"
@errno = global i32 0
define i32 @serial_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_SYNC
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
ret i32 %7
}
unsigned long _xgetbv_32(unsigned int index) {
  unsigned int eax, edx;
  __asm__ __volatile__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(index));
  return eax;
}


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

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

LLVM IR (-O0):
define i64 @_xgetbv_32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm sideeffect "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @_xgetbv_32(i32 %0) {
%2 = tail call { i32, i32 } asm sideeffect "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
struct rtc_time {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int ds1672_set_datetime(int /*<<< orphan*/, struct rtc_time *);
int /*<<< orphan*/ to_i2c_client(struct device *);
int ds1672_rtc_set_time(struct device *dev, struct rtc_time *tm) {
  return ds1672_set_datetime(to_i2c_client(dev), tm);
}


x86 assembly (clang, -O0):
<ds1672_rtc_set_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <to_i2c_client@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <ds1672_set_datetime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1672_rtc_set_time>:
push   %rbx
mov    %rsi,%rbx
call   1030 <to_i2c_client@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ds1672_set_datetime@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.rtc_time = type { i32 }
define i32 @ds1672_rtc_set_time(%struct.device* %0, %struct.rtc_time* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.rtc_time*
store %struct.device* %0, %struct.device** %3
store %struct.rtc_time* %1, %struct.rtc_time** %4
%5 = load %struct.device*, %struct.device** %3
%6 = call i32 @to_i2c_client(%struct.device* %5)
%7 = load %struct.rtc_time*, %struct.rtc_time** %4
%8 = call i32 @ds1672_set_datetime(i32 %6, %struct.rtc_time* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.rtc_time = type { i32 }
define i32 @ds1672_rtc_set_time(%struct.device* %0, %struct.rtc_time* %1) {
%3 = tail call i32 @to_i2c_client(%struct.device* %0)
%4 = tail call i32 @ds1672_set_datetime(i32 %3, %struct.rtc_time* %1)
ret i32 %4
}
double maxf(const double x, const double y) {
  if (x >= y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<maxf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     112d <maxf+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <maxf+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxf>:
movapd %xmm1,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @maxf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp oge double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @maxf(double %0, double %1) {
%3 = fcmp oge double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(void) {
  int cnt;
  mtrace();
  for (cnt = 0; cnt < 100; ++cnt) {
    setlocale(LC_ALL, "de_DE.ISO-8859-1");
    setlocale(LC_ALL, "de_DE.UTF-8");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <mtrace@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    117f <main+0x5f>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <setlocale@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <mtrace@plt>
mov    $0x64,%ebp
mov    0x2ea6(%rip),%rbx
lea    0xebf(%rip),%r14
lea    0xec9(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <setlocale@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <setlocale@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [17 x i8] c"de_DE.ISO-8859-1\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @mtrace()
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @LC_ALL
%11 = call i32 @setlocale(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [17 x i8] c"de_DE.ISO-8859-1\00"
@.str.1 = [12 x i8] c"de_DE.UTF-8\00"
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = load i32, i32* @LC_ALL
%5 = tail call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @LC_ALL
%7 = tail call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 0
}
void inputformat(char *fullarg) {
  while ((*fullarg) != '\0') {
    if ((*fullarg) < 32 || (*fullarg) == 127) {
      if ((*fullarg) != 9 && (*fullarg) != 10) {
        (*fullarg) = ' ';
      }
    }
    fullarg++;
  }
  return;
}


x86 assembly (clang, -O0):
<inputformat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1175 <inputformat+0x75>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jl     1138 <inputformat+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7f,%eax
jne    1164 <inputformat+0x64>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     115f <inputformat+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115f <inputformat+0x5f>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    1164 <inputformat+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <inputformat+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputformat>:
mov    (%rdi),%al
test   %al,%al
je     112f <inputformat+0x2f>
add    $0x1,%rdi
jmp    111b <inputformat+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112f <inputformat+0x2f>
lea    -0x20(%rax),%ecx
cmp    $0x5f,%cl
jb     1110 <inputformat+0x10>
add    $0xf7,%al
cmp    $0x2,%al
jb     1110 <inputformat+0x10>
movb   $0x20,-0x1(%rdi)
jmp    1110 <inputformat+0x10>
ret

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

LLVM IR (-O2):
define void @inputformat(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = add i8 %5, -32
%8 = icmp ult i8 %7, 95
%9 = add i8 %5, -9
%10 = icmp ult i8 %9, 2
%11 = or i1 %8, %10
br i1 %11, label %13, label %12
12: ; preds = %4
store i8 32, i8* %6
br label %13
13: ; preds = %4, %12
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %13, %1
ret void
}
void rop3_167_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_167_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_167_1_0>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%cl
and    %cl,%al
xor    %dl,%al
or     %sil,%al
not    %al
and    %sil,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_167_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_167_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ frag_more(int);
int /*<<< orphan*/ md_number_to_chars(int /*<<< orphan*/, int, int);
void out_two(int data) { md_number_to_chars(frag_more(2), data, 2); }


x86 assembly (clang, -O0):
<out_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <frag_more@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    $0x2,%edx
call   1030 <md_number_to_chars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_two>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1040 <frag_more@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    $0x2,%edx
pop    %rbx
jmp    1030 <md_number_to_chars@plt>

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

LLVM IR (-O2):
define void @out_two(i32 %0) {
%2 = tail call i32 @frag_more(i32 2)
%3 = tail call i32 @md_number_to_chars(i32 %2, i32 %0, i32 2)
ret void
}
/* Variables and functions */
int vsprintf(char *, char const *, void **);
int sprintf(char *buf, const char *fmt, ...) {
  void **pp = (void **)&fmt;
  return vsprintf(buf, fmt, pp + 1);
}


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

x86 assembly (clang, -O2):
<sprintf>:
push   %rax
mov    %rsi,(%rsp)
lea    0x8(%rsp),%rdx
call   1030 <vsprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = call i32 @vsprintf(i8* %6, i8* %7, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sprintf(i8* nocapture %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = call i32 @vsprintf(i8* %0, i8* %1, i8** %4)
ret i32 %5
}
const char *dns_vendor(void) { return "william@25thandClement.com"; }


x86 assembly (clang, -O0):
<dns_vendor>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_vendor>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @dns_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @dns_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_msat(uintptr_t);
void fiat_p384_msat(uint32_t out1[13]) {
  internal_fiat_p384_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_p384_msat>:
jmp    1030 <internal_fiat_p384_msat@plt>

LLVM IR (-O0):
define void @fiat_p384_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p384_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p384_msat(i64 %2)
ret void
}
/* Type definitions */
typedef size_t uint;

/* Variables and functions */
void string_copy(char *dest, const char *src) {
  uint i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
}


x86 assembly (clang, -O0):
<string_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <string_copy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <string_copy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_copy>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <string_copy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <string_copy+0x10>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @string_copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret void
}