xunge/DecIR huggingface dataset:
unsigned xrop3_176_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~S;
  stk2 = D | stk3;
  stk1 = T & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_176_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_176_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
and    %esi,%edi
and    %esi,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_176_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = and i8 %1, %0
%8 = zext i8 %7 to i32
%9 = and i32 %6, %5
%10 = or i32 %9, %8
ret i32 %10
}
void RTTarFileGetTime(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarFileGetTime() {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("EOF:%d\n", EOF);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"EOF:%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void logEvent(char *str) {}


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

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

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

LLVM IR (-O2):
define void @logEvent(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *error_message) {
  perror(error_message);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_address_exp(struct Cyc_Absyn_Exp *, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Toc_address_lvalue(struct Cyc_Absyn_Exp *e1,
                                             int ignore) {
  return ({ Cyc_Absyn_address_exp(e1, 0U); });
}


x86 assembly (clang, -O0):
<Cyc_Toc_address_lvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <Cyc_Absyn_address_exp@plt>
mov    %eax,-0x10(%rbp)
movslq -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Toc_address_lvalue>:
push   %rax
xor    %esi,%esi
call   1030 <Cyc_Absyn_address_exp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Toc_address_lvalue(%struct.Cyc_Absyn_Exp* %0, i32 %1) {
%3 = alloca %struct.Cyc_Absyn_Exp*
%4 = alloca i32
%5 = alloca i32
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %3
store i32 %1, i32* %4
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
%7 = call i32 @Cyc_Absyn_address_exp(%struct.Cyc_Absyn_Exp* %6, i32 0)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %10
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Toc_address_lvalue(%struct.Cyc_Absyn_Exp* %0, i32 %1) {
%3 = tail call i32 @Cyc_Absyn_address_exp(%struct.Cyc_Absyn_Exp* %0, i32 0)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Cyc_Absyn_Exp*
ret %struct.Cyc_Absyn_Exp* %5
}
void setLED() {}


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

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

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

LLVM IR (-O2):
define void @setLED() {
ret void
}
void clear_bit(int nr, int *addr) {
  *(addr + (nr >> 5)) &= ~(1 << (nr & 0x1f));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
sar    $0x5,%ecx
movslq %ecx,%rcx
and    %eax,(%rsi,%rcx,4)
ret

LLVM IR (-O0):
define void @clear_bit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i32*, i32** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = and i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 31
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = and i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int EOF;
int getchar();
void purger(void) {
  int c;
  while ((c = getchar()) != '\n' && c != EOF) {
  }
}


x86 assembly (clang, -O0):
<purger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     1144 <purger+0x34>
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1154 <purger+0x44>
jmp    1159 <purger+0x49>
jmp    1118 <purger+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<purger>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <purger+0x20>
cmp    (%rbx),%eax
jne    1120 <purger+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @purger() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br label %9
9: ; preds = %5, %2
%10 = phi i1 [ false, %2 ], [ %8, %5 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @purger() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void PWMClockSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000FC8))) &
        ~(0x00000100 | 0x00000007)) |
       ui32Config);
}


x86 assembly (clang, -O0):
<PWMClockSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffef8,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMClockSet>:
movslq %edi,%rax
mov    $0xfffffef8,%ecx
and    0xfc8(%rax),%ecx
or     %esi,%ecx
mov    %ecx,0xfc8(%rax)
ret

LLVM IR (-O0):
define void @PWMClockSet(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 = add nsw i32 %5, 4040
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -264
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 4040
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @PWMClockSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 4040
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -264
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
ret void
}
/* Variables and functions */
scalar_t__ _chdir(char const *);
int /*<<< orphan*/ _response(char *);
int do_cwd(const char *dir) {
  if (_chdir(dir) < 0) {
    return -1;
  } else {
    _response("250 Command ok.\r\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<do_cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_chdir@plt>
cmp    $0x0,%rax
jge    114b <do_cwd+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <do_cwd+0x3e>
lea    0xeae(%rip),%rdi
call   1030 <_response@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cwd>:
push   %rax
call   1040 <_chdir@plt>
test   %rax,%rax
js     113b <do_cwd+0x1b>
lea    0xece(%rip),%rdi
call   1030 <_response@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"250 Command ok.\0D\0A\00"
define i32 @do_cwd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @_chdir(i8* %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %10
8: ; preds = %1
%9 = call i32 @_response(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"250 Command ok.\0D\0A\00"
define i32 @do_cwd(i8* %0) {
%2 = tail call i64 @_chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @_response(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
int vde_chain_nm10_init(int *n_in, int *n_out, int *n_int, int *n_real) {
  if (n_in)
    *n_in = 4;
  if (n_out)
    *n_out = 3;
  if (n_int)
    *n_int = 0;
  if (n_real)
    *n_real = 0;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm10_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm10_init+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm10_init+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm10_init+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm10_init+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm10_init>:
test   %rdi,%rdi
je     110b <vde_chain_nm10_init+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm10_init+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm10_init+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm10_init+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm10_init(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
long long bit39() { return 0x0000008000000000LL; }


x86 assembly (clang, -O0):
<bit39>:
push   %rbp
mov    %rsp,%rbp
movabs $0x8000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit39>:
movabs $0x8000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit39() {
ret i64 549755813888
}

LLVM IR (-O2):
define i64 @bit39() {
ret i64 549755813888
}
/* Variables and functions */
int stringEndsWith(char const *, char *);
bool parameterIsPointer(const char *parameterType) {
  return stringEndsWith(parameterType, " *");
}


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

x86 assembly (clang, -O2):
<parameterIsPointer>:
lea    0xee9(%rip),%rsi
jmp    1030 <stringEndsWith@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" *\00"
define i32 @parameterIsPointer(i8* %0) {
%2 = tail call i32 @stringEndsWith(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getCommandLine(int *, double *, int, char **);
int /*<<< orphan*/ printHeader(int, double);
int /*<<< orphan*/ printSet(int, double);
int main(int argc, char **argv) {
  int density;
  double maxRadius;
  getCommandLine(&density, &maxRadius, argc, argv);
  printHeader(density, maxRadius);
  printSet(density, maxRadius);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <getCommandLine@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1030 <printHeader@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <getCommandLine@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1030 <printHeader@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @getCommandLine(i32* %5, double* %6, i32 %7, i8** %8)
%10 = load i32, i32* %5
%11 = load double, double* %6
%12 = call i32 @printHeader(i32 %10, double %11)
%13 = load i32, i32* %5
%14 = load double, double* %6
%15 = call i32 @printSet(i32 %13, double %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @getCommandLine(i32* %3, double* %4, i32 %0, i8** %1)
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = call i32 @printHeader(i32 %8, double %9)
%11 = load i32, i32* %3
%12 = load double, double* %4
%13 = call i32 @printSet(i32 %11, double %12)
ret i32 0
}
int test_bit(void *data, int length, int bit) {
  int boffset;
  boffset = bit / 8;
  bit %= 8;
  if (boffset > length) {
    return -1;
  }
  if (((char *)data)[boffset] & bit) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1142 <test_bit+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <test_bit+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    -0x18(%rbp),%eax
cmp    $0x0,%eax
je     1166 <test_bit+0x66>
movl   $0x1,-0x4(%rbp)
jmp    116d <test_bit+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
lea    0x7(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
mov    %ecx,%r8d
sar    $0x3,%r8d
mov    $0xffffffff,%eax
cmp    %esi,%r8d
jg     112c <test_bit+0x2c>
and    $0xfffffff8,%ecx
sub    %ecx,%edx
movslq %r8d,%rax
movsbl (%rdi,%rax,1),%ecx
xor    %eax,%eax
test   %ecx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @test_bit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sdiv i32 %2, 8
%5 = srem i32 %2, 8
%6 = icmp sgt i32 %4, %1
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = sext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 %5, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %7, %3
%16 = phi i32 [ -1, %3 ], [ %14, %7 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int isdigit(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int ls_isdigit(int c) {
  int ret;
  setlocale(LC_ALL, "");
  ret = isdigit(c);
  setlocale(LC_ALL, "C");
  return ret;
}


x86 assembly (clang, -O0):
<ls_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_isdigit>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec3(%rip),%r14
mov    (%r14),%edi
lea    0xeda(%rip),%rsi
call   1030 <setlocale@plt>
add    $0xffffffd0,%ebx
xor    %ebp,%ebp
cmp    $0xa,%ebx
setb   %bpl
mov    (%r14),%edi
lea    0xebe(%rip),%rsi
call   1030 <setlocale@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @isdigit(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isdigit(i32 %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %0, -48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
%7 = load i32, i32* @LC_ALL
%8 = tail call i32 @setlocale(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %6
}
/* Variables and functions */
size_t strlen(char *);
char *ConfigConvertToPath(char *path) {
  size_t len = strlen(path);
  if (len > 0) {
    if (path[len - 1] == '/' || path[len - 1] == '\\')
      path[len - 1] = '\0';
  }
  return (path);
}


x86 assembly (clang, -O0):
<ConfigConvertToPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    117b <ConfigConvertToPath+0x6b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1166 <ConfigConvertToPath+0x56>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1176 <ConfigConvertToPath+0x66>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    117b <ConfigConvertToPath+0x6b>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigConvertToPath>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     1131 <ConfigConvertToPath+0x21>
mov    -0x1(%rax,%rbx,1),%cl
cmp    $0x5c,%cl
je     112c <ConfigConvertToPath+0x1c>
cmp    $0x2f,%cl
jne    1131 <ConfigConvertToPath+0x21>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ConfigConvertToPath(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %9 [
i8 47, label %8
i8 92, label %8
]
8: ; preds = %4, %4
store i8 0, i8* %6
br label %9
9: ; preds = %4, %8, %1
ret i8* %0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, long);
long readlong(char *);
int main() {
  long l;
  l = readlong("Enter a number");
  printf("You entered: %ld\n", l);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <readlong@plt>
lea    0xedb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [18 x i8] c"You entered: %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i64 @readlong(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter a number\00"
@.str.1 = [18 x i8] c"You entered: %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @readlong(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i64 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ log_err(int, char *, ...);
void log_err_write(char *fname) {
  if (fname != NULL)
    log_err(1, "Could not write to %s", fname);
  else
    log_err(1, "Could not write output.");
}


x86 assembly (clang, -O0):
<log_err_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <log_err_write+0x33>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1030 <log_err@plt>
jmp    1156 <log_err_write+0x46>
mov    $0x1,%edi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <log_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err_write>:
test   %rdi,%rdi
je     112b <log_err_write+0x1b>
mov    %rdi,%rdx
lea    0xee1(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <log_err@plt>
lea    0xee4(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <log_err@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Could not write to %s\00"
@.str.1 = [24 x i8] c"Could not write output.\00"
define void @log_err_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @log_err(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 (i32, i8*, ...) @log_err(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Could not write to %s\00"
@.str.1 = [24 x i8] c"Could not write output.\00"
define void @log_err_write(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, i8*, ...) @log_err(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (i32, i8*, ...) @log_err(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __libc_fini_array();
int /*<<< orphan*/ __libc_init_array();
int /*<<< orphan*/ main();
void _start(void) {
  __libc_init_array();
  main();
  __libc_fini_array();
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__libc_init_array@plt>
mov    $0x0,%al
call   1050 <main@plt>
mov    $0x0,%al
call   1040 <__libc_fini_array@plt>
jmp    1149 <_start+0x19>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <__libc_init_array@plt>
xor    %eax,%eax
call   1050 <main@plt>
xor    %eax,%eax
call   1040 <__libc_fini_array@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <_start+0x20>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @__libc_init_array()
%2 = call i32 (...) @main()
%3 = call i32 (...) @__libc_fini_array()
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @__libc_init_array()
%2 = tail call i32 (...) @main()
%3 = tail call i32 (...) @__libc_fini_array()
br label %4
4: ; preds = %4, %0
br label %4
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
main() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  fprintf(stdout, "%lu %lu\n", tv.tv_sec, tv.tv_usec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%ecx
mov    0x4(%rsp),%edx
lea    0xebe(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@stdout = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = load i32, i32* @stdout
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@stdout = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = load i32, i32* @stdout
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *malloc(long);
int /*<<< orphan*/ stderr;
char *stringAllocate(long stringLength) {
  char *string = malloc(stringLength + 1);
  if (string == NULL) {
    fprintf(stderr, "ERROR: Memory could not be allocated for string copy.\n");
    exit(EXIT_FAILURE);
  }
  return string;
}


x86 assembly (clang, -O0):
<stringAllocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <stringAllocate+0x4b>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringAllocate>:
push   %rax
add    $0x1,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1141 <stringAllocate+0x11>
pop    %rcx
ret
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: Memory could not be allocated for string copy.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @stringAllocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"ERROR: Memory could not be allocated for string copy.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @stringAllocate(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ b64enc_buf(unsigned char const *, int, char *);
char *malloc(int);
char *b64enc(const unsigned char *data, int len) {
  char *dest;
  dest = malloc(4 * len / 3 + 4);
  b64enc_buf(data, len, dest);
  return (dest);
}


x86 assembly (clang, -O0):
<b64enc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <b64enc_buf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64enc>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x0(,%r15,4),%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%edi
add    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1030 <b64enc_buf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @b64enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 4, %6
%8 = sdiv i32 %7, 3
%9 = add nsw i32 %8, 4
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = load i8*, i8** %5
%14 = call i32 @b64enc_buf(i8* %11, i32 %12, i8* %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @b64enc(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = sdiv i32 %3, 3
%5 = add nsw i32 %4, 4
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @b64enc_buf(i8* %0, i32 %1, i8* %6)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
         "MBEDTLS_SHA256_C and/or MBEDLTS_MD_C and/or "
         "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or "
         "MBEDTLS_CTR_DRBG_C not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [173 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SHA256_C and/or MBEDLTS_MD_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [172 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SHA256_C and/or MBEDLTS_MD_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([172 x i8], [172 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int map_parameter_oceanographic_surface(int center, int disc, int param_cat,
                                        int param_num) {
  (void)(disc);
  (void)(center);
  (void)(param_cat);
  switch (param_num) {
  case 0:
    return 80;
  case 1:
    return 82;
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<map_parameter_oceanographic_surface>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     1134 <map_parameter_oceanographic_surface+0x34>
jmp    1123 <map_parameter_oceanographic_surface+0x23>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     1140 <map_parameter_oceanographic_surface+0x40>
jmp    114c <map_parameter_oceanographic_surface+0x4c>
movl   $0x50,-0x4(%rbp)
jmp    1158 <map_parameter_oceanographic_surface+0x58>
movl   $0x52,-0x4(%rbp)
jmp    1158 <map_parameter_oceanographic_surface+0x58>
jmp    1151 <map_parameter_oceanographic_surface+0x51>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_parameter_oceanographic_surface>:
cmp    $0x1,%ecx
mov    $0x52,%eax
mov    $0xffffffff,%edx
cmove  %eax,%edx
test   %ecx,%ecx
mov    $0x50,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @map_parameter_oceanographic_surface(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = load i32, i32* %9
switch i32 %13, label %16 [
i32 0, label %14
i32 1, label %15
]
14: ; preds = %4
store i32 80, i32* %5
br label %18
15: ; preds = %4
store i32 82, i32* %5
br label %18
16: ; preds = %4
br label %17
17: ; preds = %16
store i32 -1, i32* %5
br label %18
18: ; preds = %17, %15, %14
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @map_parameter_oceanographic_surface(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 1
%6 = select i1 %5, i32 82, i32 -1
%7 = icmp eq i32 %3, 0
%8 = select i1 %7, i32 80, i32 %6
ret i32 %8
}
int alpha_compare(s1, s2)
char **s1, **s2;
{
  if (**s1 != **s2)
    return **s1 - **s2;
  return strcmp(*s1, *s2);
}


x86 assembly (clang, -O0):
<alpha_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115a <alpha_compare+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <alpha_compare+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_compare>:
mov    (%rdi),%rdi
movsbl (%rdi),%eax
mov    (%rsi),%rsi
movsbl (%rsi),%ecx
cmp    %cl,%al
jne    1125 <alpha_compare+0x15>
jmp    1030 <strcmp@plt>
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @alpha_compare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = icmp eq i8 %4, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = sext i8 %6 to i32
%10 = sext i8 %4 to i32
%11 = sub nsw i32 %10, %9
br label %14
12: ; preds = %2
%13 = tail call i32 @strcmp(i8* %3, i8* %5)
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}
int xyz() { return 1; }


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

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

LLVM IR (-O0):
define i32 @xyz() {
ret i32 1
}

LLVM IR (-O2):
define i32 @xyz() {
ret i32 1
}
void __noop_(void) {}


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

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

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

LLVM IR (-O2):
define void @__noop_() {
ret void
}
int max2i(int x, int y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<max2i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max2i+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max2i+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max2i>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max2i(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int test_client_block();
int main() {
  int nret = 0;
  nret = test_client_block();
  return -nret;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_client_block()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_client_block()
%2 = sub nsw i32 0, %1
ret i32 %2
}