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

/* Variables and functions */
uint64_t shiftl64(uint64_t a, uint8_t r) { return (a << r); }


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

x86 assembly (clang, -O2):
<shiftl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @shiftl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t addr2page(uint16_t address) {
  if (address < 0xfa00) {
    return address >> 9;
  } else if (address < 0xfb00) {
    return 32;
  } else if (address < 0xfc00) {
    return 33;
  } else if (address < 0xfe00) {
    return 34;
  }
  return 35;
}


x86 assembly (clang, -O0):
<addr2page>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfa00,-0x8(%rbp)
jge    1122 <addr2page+0x22>
mov    -0x8(%rbp),%eax
sar    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <addr2page+0x83>
cmpl   $0xfb00,-0x8(%rbp)
jge    113b <addr2page+0x3b>
movl   $0x20,-0x4(%rbp)
jmp    1183 <addr2page+0x83>
cmpl   $0xfc00,-0x8(%rbp)
jge    1154 <addr2page+0x54>
movl   $0x21,-0x4(%rbp)
jmp    1183 <addr2page+0x83>
cmpl   $0xfe00,-0x8(%rbp)
jge    116d <addr2page+0x6d>
movl   $0x22,-0x4(%rbp)
jmp    1183 <addr2page+0x83>
jmp    1172 <addr2page+0x72>
jmp    1177 <addr2page+0x77>
jmp    117c <addr2page+0x7c>
movl   $0x23,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr2page>:
cmp    $0xf9ff,%edi
jg     110e <addr2page+0xe>
sar    $0x9,%edi
mov    %edi,%eax
ret
mov    $0x20,%eax
cmp    $0xfb00,%edi
jb     1136 <addr2page+0x36>
mov    $0x21,%eax
cmp    $0xfc00,%edi
jb     1136 <addr2page+0x36>
cmp    $0xfe00,%edi
mov    $0x23,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @addr2page(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 64000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 9
store i32 %8, i32* %2
br label %25
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 64256
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 32, i32* %2
br label %25
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 64512
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 33, i32* %2
br label %25
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 65024
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 34, i32* %2
br label %25
21: ; preds = %17
br label %22
22: ; preds = %21
br label %23
23: ; preds = %22
br label %24
24: ; preds = %23
store i32 35, i32* %2
br label %25
25: ; preds = %24, %20, %16, %12, %6
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @addr2page(i32 %0) {
%2 = icmp slt i32 %0, 64000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = ashr i32 %0, 9
br label %12
5: ; preds = %1
%6 = icmp ult i32 %0, 64256
br i1 %6, label %12, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 64512
br i1 %8, label %12, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 65024
%11 = select i1 %10, i32 34, i32 35
br label %12
12: ; preds = %9, %7, %5, %3
%13 = phi i32 [ %4, %3 ], [ 32, %5 ], [ 33, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"usage: chmod [-fhv] [-R [-H | -L | -P]] mode file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct b6_splay {
  int dummy;
};
struct b6_dref {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ b6_splay_add(struct b6_splay *, int, struct b6_dref *);
int do_search(struct b6_splay *, int *, struct b6_dref *);
int do_add(struct b6_splay *splay, struct b6_dref *ref) {
  int dir, ret;
  if ((ret = do_search(splay, &dir, ref)))
    b6_splay_add(splay, dir, ref);
  return ret;
}


x86 assembly (clang, -O0):
<do_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1030 <do_search@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     115d <do_add+0x3d>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <b6_splay_add@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_add>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
mov    %r14,%rdx
call   1030 <do_search@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1150 <do_add+0x30>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <b6_splay_add@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.b6_splay = type { i32 }
%struct.b6_dref = type { i32 }
define i32 @do_add(%struct.b6_splay* %0, %struct.b6_dref* %1) {
%3 = alloca %struct.b6_splay*
%4 = alloca %struct.b6_dref*
%5 = alloca i32
%6 = alloca i32
store %struct.b6_splay* %0, %struct.b6_splay** %3
store %struct.b6_dref* %1, %struct.b6_dref** %4
%7 = load %struct.b6_splay*, %struct.b6_splay** %3
%8 = load %struct.b6_dref*, %struct.b6_dref** %4
%9 = call i32 @do_search(%struct.b6_splay* %7, i32* %5, %struct.b6_dref* %8)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load %struct.b6_splay*, %struct.b6_splay** %3
%13 = load i32, i32* %5
%14 = load %struct.b6_dref*, %struct.b6_dref** %4
%15 = call i32 @b6_splay_add(%struct.b6_splay* %12, i32 %13, %struct.b6_dref* %14)
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %6
ret i32 %17
}

LLVM IR (-O2):
%struct.b6_splay = type { i32 }
%struct.b6_dref = type { i32 }
define i32 @do_add(%struct.b6_splay* %0, %struct.b6_dref* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @do_search(%struct.b6_splay* %0, i32* %3, %struct.b6_dref* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @b6_splay_add(%struct.b6_splay* %0, i32 %8, %struct.b6_dref* %1)
br label %10
10: ; preds = %7, %2
ret i32 %5
}
/* Variables and functions */
int remove(char *);
int wfile_remove_utf8(char *filename) { return (remove(filename)); }


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

x86 assembly (clang, -O2):
<wfile_remove_utf8>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @wfile_remove_utf8(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool is_realtime(uint8_t b) { return (b >= 0xF8); }


x86 assembly (clang, -O0):
<is_realtime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xf8,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_realtime>:
xor    %eax,%eax
cmp    $0xf8,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @is_realtime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 248
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_realtime(i32 %0) {
%2 = icmp sgt i32 %0, 247
%3 = zext i1 %2 to i32
ret i32 %3
}
void delay(int delaytime) {
  int i, j;
  for (i = 0; i < delaytime; i++) {
    for (j = 5000; j > 0; j--)
      ;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <delay+0x51>
movl   $0x1388,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113e <delay+0x3e>
jmp    1130 <delay+0x30>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <delay+0x21>
jmp    1143 <delay+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
__attribute__((always_)) int is_si_special(const struct siginfo *info) {
  return info <= ((struct siginfo *)2);
}


x86 assembly (clang, -O0):
<is_si_special>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%eax
cmp    %rax,-0x8(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_si_special>:
xor    %eax,%eax
cmp    $0x3,%rdi
setb   %al
ret

LLVM IR (-O0):
%struct.siginfo = type opaque
define i32 @is_si_special(%struct.siginfo* %0) {
%2 = alloca %struct.siginfo*
store %struct.siginfo* %0, %struct.siginfo** %2
%3 = load %struct.siginfo*, %struct.siginfo** %2
%4 = icmp ule %struct.siginfo* %3, inttoptr (i64 2 to %struct.siginfo*)
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.siginfo = type opaque
define i32 @is_si_special(%struct.siginfo* readnone %0) {
%2 = icmp ule %struct.siginfo* %0, inttoptr (i64 2 to %struct.siginfo*)
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double calc_volume(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float raio;
  printf("Informe o raio da esfera: ");
  scanf("%f", &raio);
  printf("O volume da esfera eh de: %.2f\n", calc_volume(raio));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <calc_volume@plt>
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <calc_volume@plt>
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Informe o raio da esfera: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"O volume da esfera eh de: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call double @calc_volume(float %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Informe o raio da esfera: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [32 x i8] c"O volume da esfera eh de: %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call double @calc_volume(float %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeI2C(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000009);
}


x86 assembly (clang, -O0):
<GPIOPinTypeI2C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x9,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeI2C>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x9,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeI2C(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 2)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 1, i32 9)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeI2C(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int STATUS_FUNC() {
  printf("No status to report");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"No status to report\00"
define i32 @STATUS_FUNC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"No status to report\00"
define i32 @STATUS_FUNC() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_common(struct flashctx *, int);
int printlock_w39v040c(struct flashctx *flash) {
  return printlock_w39_common(flash, 0xfff2);
}


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

x86 assembly (clang, -O2):
<printlock_w39v040c>:
mov    $0xfff2,%esi
jmp    1030 <printlock_w39_common@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040c(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @printlock_w39_common(%struct.flashctx* %3, i32 65522)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @printlock_w39v040c(%struct.flashctx* %0) {
%2 = tail call i32 @printlock_w39_common(%struct.flashctx* %0, i32 65522)
ret i32 %2
}
void Fan(int fancmd) {}


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

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

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

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

/* Variables and functions */
void flash_writel(uint32_t addr, uint32_t val, void *p) {}


x86 assembly (clang, -O0):
<flash_writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @flash_writel(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @flash_writel(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f3(void) { puts("\nf3"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0Af3\00"
define void @f3() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0Af3\00"
define void @f3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
char *appaserver_link_get_output_filename(char *, char *, char *, char *,
                                          char *, int /*<<< orphan*/, char *,
                                          char *);
char *appaserver_link_output_filename(char *document_root_directory,
                                      char *application_name,
                                      char *filename_stem,
                                      char *begin_date_string,
                                      char *end_date_string, pid_t process_id,
                                      char *session, char *extension) {
  return appaserver_link_get_output_filename(
      document_root_directory, application_name, filename_stem,
      begin_date_string, end_date_string, process_id, session, extension);
}


x86 assembly (clang, -O0):
<appaserver_link_output_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <appaserver_link_get_output_filename@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_link_output_filename>:
jmp    1030 <appaserver_link_get_output_filename@plt>

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

LLVM IR (-O2):
define i8* @appaserver_link_output_filename(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* %7) {
%9 = tail call i8* @appaserver_link_get_output_filename(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* %7)
ret i8* %9
}
int test_imm_33int8_reg(signed char val) {
  return ((val) & (-0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffcd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_33int8_reg>:
test   $0xcd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -51
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_33int8_reg(i8 signext %0) {
%2 = and i8 %0, -51
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void version(const char *target, const char *class) {
  printf("%s (%s) from "
         "wimIP"
         " v"
         "1"
         "."
         "0"
         "\n",
         target, class);
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"%s (%s) from wimIP v1.0\0A\00"
define void @version(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s (%s) from wimIP v1.0\0A\00"
define void @version(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
double max(double x, double y) {
  if (x >= y) {
    return x;
  } else {
    return y;
  }
}


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

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

LLVM IR (-O0):
define double @max(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 @max(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*/ link_error();
void foo(int b) {
  int a;
  a = b + 2;
  a--;
  a--;
  if (a != b)
    link_error();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1149 <foo+0x39>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, -1
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 (...) @link_error()
br label %15
15: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char *const);
void print_unique_files(char *const *files, const char *dir_name,
                        unsigned len) {
  unsigned i = 0;
  while (i < len) {
    printf("Only in %s: %s\n", dir_name, files[i++]);
  }
  return;
}


x86 assembly (clang, -O0):
<print_unique_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1160 <print_unique_files+0x50>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <print_unique_files+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unique_files>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
je     1148 <print_unique_files+0x38>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r12,%rbx,8),%rdx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
cmp    %rbx,%r13
jne    1130 <print_unique_files+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Only in %s: %s\0A\00"
define void @print_unique_files(i8** %0, i8* %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %4
%15 = load i32, i32* %7
%16 = add i32 %15, 1
store i32 %16, i32* %7
%17 = zext i32 %15 to i64
%18 = getelementptr inbounds i8*, i8** %14, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %19)
br label %8
21: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Only in %s: %s\0A\00"
define void @print_unique_files(i8** nocapture %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %8
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %11)
%13 = icmp eq i64 %9, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
int main() {
  int i, j;
  j = 1;
  i = 10000;
  while (i - j >= 1) {
    j = j + 1;
    i = i - 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2710,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jl     113f <main+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 10000, i32* %2
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = icmp sge i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long mixed_sub(void *a, unsigned long b) { return (long)a - b; }


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

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

LLVM IR (-O0):
define i64 @mixed_sub(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = sub i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @mixed_sub(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sub i64 %3, %1
ret i64 %4
}
/* Variables and functions */
long double DBL_MAX;
long double xBeta_Function(long double, long double);
double Beta_Function(double a, double b) {
  long double beta = xBeta_Function((long double)a, (long double)b);
  return (beta < DBL_MAX) ? (double)beta : DBL_MAX;
}


x86 assembly (clang, -O0):
<Beta_Function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
fldl   -0x8(%rbp)
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <xBeta_Function@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    0x2e9e(%rip),%rax
fldt   (%rax)
fucomip %st(1),%st
fstp   %st(0)
jbe    116e <Beta_Function+0x5e>
jmp    1153 <Beta_Function+0x43>
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
fldl   -0x30(%rbp)
fstpt  -0x44(%rbp)
jmp    117a <Beta_Function+0x6a>
mov    0x2e6b(%rip),%rax
fldt   (%rax)
fstpt  -0x44(%rbp)
fldt   -0x44(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Beta_Function>:
sub    $0x38,%rsp
movsd  %xmm0,0x30(%rsp)
fldl   0x30(%rsp)
movsd  %xmm1,0x28(%rsp)
fldl   0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <xBeta_Function@plt>
mov    0x2ea5(%rip),%rax
fldt   (%rax)
fucomi %st(1),%st
fcmovnbe %st(1),%st
fstp   %st(1)
fstpl  0x20(%rsp)
movsd  0x20(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
@DBL_MAX = global x86_fp80 0xK00000000000000000000
define double @Beta_Function(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca x86_fp80
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fpext double %6 to x86_fp80
%8 = load double, double* %4
%9 = fpext double %8 to x86_fp80
%10 = call x86_fp80 @xBeta_Function(x86_fp80 %7, x86_fp80 %9)
store x86_fp80 %10, x86_fp80* %5
%11 = load x86_fp80, x86_fp80* %5
%12 = load x86_fp80, x86_fp80* @DBL_MAX
%13 = fcmp olt x86_fp80 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load x86_fp80, x86_fp80* %5
%16 = fptrunc x86_fp80 %15 to double
%17 = fpext double %16 to x86_fp80
br label %20
18: ; preds = %2
%19 = load x86_fp80, x86_fp80* @DBL_MAX
br label %20
20: ; preds = %18, %14
%21 = phi x86_fp80 [ %17, %14 ], [ %19, %18 ]
%22 = fptrunc x86_fp80 %21 to double
ret double %22
}

LLVM IR (-O2):
@DBL_MAX = global x86_fp80 0xK00000000000000000000
define double @Beta_Function(double %0, double %1) {
%3 = fpext double %0 to x86_fp80
%4 = fpext double %1 to x86_fp80
%5 = tail call x86_fp80 @xBeta_Function(x86_fp80 %3, x86_fp80 %4)
%6 = load x86_fp80, x86_fp80* @DBL_MAX
%7 = fcmp olt x86_fp80 %5, %6
%8 = select i1 %7, x86_fp80 %5, x86_fp80 %6
%9 = fptrunc x86_fp80 %8 to double
ret double %9
}
/* Variables and functions */
char *strchr(char *, char);
char *value(register char *p) { return ((p = strchr(p, '=')) ? ++p : NULL); }


x86 assembly (clang, -O0):
<value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     114d <value+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    1158 <value+0x48>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1158 <value+0x48>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value>:
push   %rax
mov    $0x3d,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strchr(i8* %3, i8 signext 61)
store i8* %4, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i8* [ %8, %6 ], [ null, %9 ]
ret i8* %11
}

LLVM IR (-O2):
define i8* @value(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
char *str(int length) {
  assert(length > 0);
  char *s = malloc(length * sizeof(char));
  memset(s, '\0', length);
  return s;
}


x86 assembly (clang, -O0):
<str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = call i32 @memset(i8* %13, i8 signext 0, i32 %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @str(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @malloc(i32 %0)
%6 = tail call i32 @memset(i8* %5, i8 signext 0, i32 %0)
ret i8* %5
}
/* Type definitions */
typedef char *u_short;

/* Variables and functions */
u_short _go32_my_ss() { asm("movw %ss,%ax"); }


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

x86 assembly (clang, -O2):
<_go32_my_ss>:
mov    %ss,%ax
ret

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

LLVM IR (-O2):
define i8* @_go32_my_ss() {
tail call void asm sideeffect "movw %ss,%ax", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
unsigned join(const unsigned a, const unsigned b) { return b | a; }


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

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

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

LLVM IR (-O2):
define i32 @join(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB7_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB7_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRB7_swap(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRB7_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
char *getcwd(char *, int);
scalar_t__ malloc(int);
char *GetWorkingDirectory() {
  int memorySize = 2000;
  char *workingDir = (char *)malloc(sizeof(char) * memorySize);
  workingDir = getcwd(workingDir, memorySize);
  return workingDir;
}


x86 assembly (clang, -O0):
<GetWorkingDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7d0,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <getcwd@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetWorkingDirectory>:
push   %rax
mov    $0x7d0,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x7d0,%esi
pop    %rax
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define i8* @GetWorkingDirectory() {
%1 = alloca i32
%2 = alloca i8*
store i32 2000, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = mul i64 1, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = load i32, i32* %1
%11 = call i8* @getcwd(i8* %9, i32 %10)
store i8* %11, i8** %2
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @GetWorkingDirectory() {
%1 = tail call i64 @malloc(i32 2000)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @getcwd(i8* %2, i32 2000)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t const SIZE_MAX;
int /*<<< orphan*/ assert(int);
size_t sc16q11_to_bytes(size_t n_samples) {
  const size_t sample_size = 2 * sizeof(int16_t);
  assert(n_samples <= (SIZE_MAX / sample_size));
  return n_samples * sample_size;
}


x86 assembly (clang, -O0):
<sc16q11_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%rcx
shr    $0x3,%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc16q11_to_bytes>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
sete   %dil
call   1030 <assert@plt>
shl    $0x3,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@SIZE_MAX = constant i64 0
define i64 @sc16q11_to_bytes(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 8, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* @SIZE_MAX
%6 = udiv i64 %5, 8
%7 = icmp ule i64 %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %2
%11 = mul i64 %10, 8
ret i64 %11
}

LLVM IR (-O2):
@SIZE_MAX = constant i64 0
define i64 @sc16q11_to_bytes(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = shl i64 %0, 3
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ f(int const *);
int main() {
  const int a = 5;
  f(&a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 0
}
int Min(int A, int B) { return (A < B ? A : B); }


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

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

LLVM IR (-O0):
define i32 @Min(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 slt 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 @Min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list_link {
  int dummy;
};
struct entry_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link(struct genlist const *, int);
struct entry_list_link *entry_list_link(const struct entry_list *tthis,
                                        int index) {
  return ((struct entry_list_link *)genlist_link((const struct genlist *)tthis,
                                                 index));
}


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

x86 assembly (clang, -O2):
<entry_list_link>:
jmp    1030 <genlist_link@plt>

LLVM IR (-O0):
%struct.entry_list_link = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry_list_link* @entry_list_link(%struct.entry_list* %0, i32 %1) {
%3 = alloca %struct.entry_list*
%4 = alloca i32
store %struct.entry_list* %0, %struct.entry_list** %3
store i32 %1, i32* %4
%5 = load %struct.entry_list*, %struct.entry_list** %3
%6 = bitcast %struct.entry_list* %5 to %struct.genlist*
%7 = load i32, i32* %4
%8 = call i64 @genlist_link(%struct.genlist* %6, i32 %7)
%9 = inttoptr i64 %8 to %struct.entry_list_link*
ret %struct.entry_list_link* %9
}

LLVM IR (-O2):
%struct.entry_list_link = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry_list_link* @entry_list_link(%struct.entry_list* %0, i32 %1) {
%3 = bitcast %struct.entry_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_link(%struct.genlist* %3, i32 %1)
%5 = inttoptr i64 %4 to %struct.entry_list_link*
ret %struct.entry_list_link* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *cmd) {
  printf("%s <host> [-l <username>] [-p <password]\n", cmd);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"%s <host> [-l <username>] [-p <password]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"%s <host> [-l <username>] [-p <password]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void cleanup(int sig) { exit(1); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @cleanup(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int new_int_from_bin(char *value) { return (int)strtol(value, NULL, 10); }


x86 assembly (clang, -O0):
<new_int_from_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_int_from_bin>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @new_int_from_bin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @new_int_from_bin(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() { printf("The value of EOF: %d\n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [22 x i8] c"The value of EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

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