xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ http_vlog(char const *, int /*<<< orphan*/);
void http_av_log(void *ptr, int level, const char *fmt, va_list vargs) {
  static int print_prefix = 1;
  http_vlog(fmt, vargs);
}


x86 assembly (clang, -O0):
<http_av_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <http_vlog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_av_log>:
mov    %rdx,%rdi
mov    %ecx,%esi
jmp    1030 <http_vlog@plt>

LLVM IR (-O0):
@http_av_log.print_prefix = internal global i32 1
define void @http_av_log(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %7
%10 = load i32, i32* %8
%11 = call i32 @http_vlog(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @http_av_log(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @http_vlog(i8* %2, i32 %3)
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels24_10_sse4() {
ret void
}
int glob_match(pattern, s)
char *pattern;
char *s;
{
  int result;
  char buffer[1024];
  if ((result = glob_compile(pattern, buffer)) < 0)
    return (result);
  else
    return (glob_execute(buffer, s));
}


x86 assembly (clang, -O0):
<glob_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x0,%al
call   1040 <glob_compile@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115c <glob_match+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <glob_match+0x51>
lea    -0x420(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <glob_execute@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glob_match>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <glob_compile@plt>
test   %eax,%eax
js     1146 <glob_match+0x26>
mov    %rsp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <glob_execute@plt>
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @glob_match(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @glob_compile to i32 (i8*, i8*, ...)*)(i8* %0, i8* %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @glob_execute to i32 (i8*, i8*, ...)*)(i8* %4, i8* %1)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
int test_imm_AEint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11403264
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ body();
void f_nonempty_while_loop() {
  while (1) {
    body();
  }
}


x86 assembly (clang, -O0):
<f_nonempty_while_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <f_nonempty_while_loop+0x9>
mov    $0x0,%al
call   1030 <body@plt>
jmp    1119 <f_nonempty_while_loop+0x9>

x86 assembly (clang, -O2):
<f_nonempty_while_loop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <body@plt>
jmp    1120 <f_nonempty_while_loop+0x10>

LLVM IR (-O0):
define void @f_nonempty_while_loop() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @body()
br label %1
}

LLVM IR (-O2):
define void @f_nonempty_while_loop() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @body()
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ia_unsetbit8(int /*<<< orphan*/, int);
void ia_unsetbitv(uint8_t *bytes, int i) {
  bytes[i / 8] = ia_unsetbit8(bytes[i / 8], i % 8);
}


x86 assembly (clang, -O0):
<ia_unsetbitv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
call   1030 <ia_unsetbit8@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_unsetbitv>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rbx
mov    (%rdi,%rbx,4),%edi
and    $0xfffffff8,%eax
sub    %eax,%esi
call   1030 <ia_unsetbit8@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ia_unsetbitv(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = call i32 @ia_unsetbit8(i32 %10, i32 %12)
%14 = load i32*, i32** %3
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %14, i64 %17
store i32 %13, i32* %18
ret void
}

LLVM IR (-O2):
define void @ia_unsetbitv(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 8
%8 = tail call i32 @ia_unsetbit8(i32 %6, i32 %7)
store i32 %8, i32* %5
ret void
}
/* Variables and functions */
char *OC_mkDotStr(char *, char *);
char *OC_mkVarDec(char *, char *);
int /*<<< orphan*/ free(char *);
char *OC_mkConstVarDec(char *constVarName) {
  char *constType = OC_mkDotStr("Absyn", "aconstant");
  char *dec = OC_mkVarDec(constVarName, constType);
  free(constType);
  return dec;
}


x86 assembly (clang, -O0):
<OC_mkConstVarDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <OC_mkDotStr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <OC_mkVarDec@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OC_mkConstVarDec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <OC_mkDotStr@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <OC_mkVarDec@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [10 x i8] c"aconstant\00"
define i8* @OC_mkConstVarDec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8* @OC_mkVarDec(i8* %6, i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"Absyn\00"
@.str.1 = [10 x i8] c"aconstant\00"
define i8* @OC_mkConstVarDec(i8* %0) {
%2 = tail call i8* @OC_mkDotStr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @OC_mkVarDec(i8* %0, i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
int dotflag(char *name) {
  if (*name++ != '.')
    return 0;
  switch (*name++) {
  case 0:
    return 'a';
  case '.':
    if (*name == 0)
      return 'a';
  default:
    return 'A';
  }
}


x86 assembly (clang, -O0):
<dotflag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     112f <dotflag+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1196 <dotflag+0x96>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1162 <dotflag+0x62>
jmp    1151 <dotflag+0x51>
mov    -0x14(%rbp),%eax
sub    $0x2e,%eax
je     116e <dotflag+0x6e>
jmp    118f <dotflag+0x8f>
movl   $0x61,-0x4(%rbp)
jmp    1196 <dotflag+0x96>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    118a <dotflag+0x8a>
movl   $0x61,-0x4(%rbp)
jmp    1196 <dotflag+0x96>
jmp    118f <dotflag+0x8f>
movl   $0x41,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotflag>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    1124 <dotflag+0x24>
movsbl 0x1(%rdi),%ecx
mov    $0x61,%eax
test   %ecx,%ecx
je     1124 <dotflag+0x24>
cmp    $0x2e,%ecx
jne    111f <dotflag+0x1f>
cmpb   $0x0,0x2(%rdi)
je     1124 <dotflag+0x24>
mov    $0x41,%eax
ret

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

LLVM IR (-O2):
define i32 @dotflag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %12 [
i32 0, label %13
i32 46, label %8
]
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8, %4
br label %13
13: ; preds = %8, %4, %1, %12
%14 = phi i32 [ 65, %12 ], [ 0, %1 ], [ 97, %4 ], [ 97, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int clockid_t;

/* Variables and functions */
int CLOCK_MONOTONIC_RAW;
#define CLOCK_REALTIME 128
clockid_t get_reference_clock(clockid_t clockid) {
  switch (clockid) {
  case CLOCK_REALTIME:
    return CLOCK_REALTIME;
  default:
    return CLOCK_MONOTONIC_RAW;
  }
}


x86 assembly (clang, -O0):
<get_reference_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    1126 <get_reference_clock+0x26>
jmp    111a <get_reference_clock+0x1a>
movl   $0x80,-0x4(%rbp)
jmp    1132 <get_reference_clock+0x32>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_reference_clock>:
mov    %edi,%eax
cmp    $0x80,%edi
je     1113 <get_reference_clock+0x13>
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @get_reference_clock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
]
5: ; preds = %1
store i32 128, i32* %2
br label %8
6: ; preds = %1
%7 = load i32, i32* @CLOCK_MONOTONIC_RAW
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @get_reference_clock(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = load i32, i32* @CLOCK_MONOTONIC_RAW
%4 = select i1 %2, i32 128, i32 %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SIGILL;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void illegal_instruction() { raise(SIGILL); }


x86 assembly (clang, -O0):
<illegal_instruction>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<illegal_instruction>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGILL = global i32 0
define void @illegal_instruction() {
%1 = load i32, i32* @SIGILL
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGILL = global i32 0
define void @illegal_instruction() {
%1 = load i32, i32* @SIGILL
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Variables and functions */
int sscanf(char *, char *, char *, char *);
int parseArguments(char arg[], char firstSort[], char secondSort[]) {
  int options = 0;
  options = sscanf(arg, "%2s%2s", firstSort, secondSort);
  return options;
}


x86 assembly (clang, -O0):
<parseArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec2(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseArguments>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sscanf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%2s%2s\00"
define i32 @parseArguments(i8* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i32 %4
}
int test_imm_3Cuint32_mem(unsigned int *val) {
  return ((*val) & (0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_3Cuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 60
%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_3Cuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 60
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_uint(char *str, unsigned int *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(unsigned int), false);
}


x86 assembly (clang, -O0):
<try_parse_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_uint>:
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_uint(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 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_uint(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 0)
ret i32 %4
}
int test_imm_EBuint8_reg(unsigned char val) {
  return ((val) & (-0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -235
%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_EBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 21
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void mkSampleDir(char *dir) {
  char *commandout;
  asprintf(&commandout, "%s %s%s%s", "sudo mkdir", "/tmp/Umweltmonitoring",
           "/mic", dir);
  system(commandout);
}


x86 assembly (clang, -O0):
<mkSampleDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    0xec8(%rip),%rdx
lea    0xecc(%rip),%rcx
lea    0xedb(%rip),%r8
call   1040 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkSampleDir>:
push   %rax
mov    %rdi,%r9
lea    0xed5(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xedc(%rip),%rcx
lea    0xeeb(%rip),%r8
mov    %rsp,%rdi
call   1040 <asprintf@plt>
mov    (%rsp),%rdi
call   1030 <system@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%s %s%s%s\00"
@.str.1 = [11 x i8] c"sudo mkdir\00"
@.str.2 = [22 x i8] c"/tmp/Umweltmonitoring\00"
@.str.3 = [5 x i8] c"/mic\00"
define void @mkSampleDir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @system(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s %s%s%s\00"
@.str.1 = [11 x i8] c"sudo mkdir\00"
@.str.2 = [22 x i8] c"/tmp/Umweltmonitoring\00"
@.str.3 = [5 x i8] c"/mic\00"
define void @mkSampleDir(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
%6 = call i32 @system(i8* %5)
ret void
}
void av_frame_set_channel_layout() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_set_channel_layout() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int stat(char const *, struct stat *);
time_t get_mtime(const char *path) {
  struct stat statbuf;
  if (stat(path, &statbuf) == -1) {
    perror(path);
    exit(1);
  }
  return statbuf.st_mtime;
}


x86 assembly (clang, -O0):
<get_mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1165 <get_mtime+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mtime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1151 <get_mtime+0x21>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_mtime(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_mtime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
/* Type definitions */
typedef double int32_t;

/* Variables and functions */
float calculate(double, double, double, float, float, double,
                int /*<<< orphan*/);
float calculate_sunset(int32_t year, int32_t month, int32_t day, float lat,
                       float lng, int32_t utc_offset) {
  return calculate(year, month, day, lat, lng, utc_offset / 4.0, 0);
}


x86 assembly (clang, -O0):
<calculate_sunset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movss  %xmm3,-0x1c(%rbp)
movss  %xmm4,-0x20(%rbp)
movsd  %xmm5,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm3
movss  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
movsd  0xea4(%rip),%xmm6
divsd  %xmm6,%xmm5
xor    %edi,%edi
call   1030 <calculate@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_sunset>:
mulsd  0xee8(%rip),%xmm5
xor    %edi,%edi
jmp    1030 <calculate@plt>

LLVM IR (-O0):
define float @calculate_sunset(double %0, double %1, double %2, float %3, float %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca float
%11 = alloca float
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store float %3, float* %10
store float %4, float* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load double, double* %12
%19 = fdiv double %18, 4.000000e+00
%20 = call float @calculate(double %13, double %14, double %15, float %16, float %17, double %19, i32 0)
ret float %20
}

LLVM IR (-O2):
define float @calculate_sunset(double %0, double %1, double %2, float %3, float %4, double %5) {
%7 = fmul double %5, 2.500000e-01
%8 = tail call float @calculate(double %0, double %1, double %2, float %3, float %4, double %7, i32 0)
ret float %8
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ usleep(int);
void inputloop() {
  int ch;
  while (1) {
    ch = getch();
    if (ch == 27 || ch == 'q') {
      break;
    } else {
      usleep(50000);
    }
  }
}


x86 assembly (clang, -O0):
<inputloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1b,-0x4(%rbp)
je     1146 <inputloop+0x26>
cmpl   $0x71,-0x4(%rbp)
jne    114b <inputloop+0x2b>
jmp    115a <inputloop+0x3a>
mov    $0xc350,%edi
call   1040 <usleep@plt>
jmp    1128 <inputloop+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputloop>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getch@plt>
cmp    $0x1b,%eax
je     114d <inputloop+0x2d>
cmp    $0x71,%eax
je     114d <inputloop+0x2d>
mov    $0xc350,%edi
call   1040 <usleep@plt>
jmp    1130 <inputloop+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @inputloop() {
%1 = alloca i32
br label %2
2: ; preds = %0, %12
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 27
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 113
br i1 %8, label %9, label %10
9: ; preds = %6, %2
br label %13
10: ; preds = %6
%11 = call i32 @usleep(i32 50000)
br label %12
12: ; preds = %10
br label %2
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @inputloop() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (...) @getch()
switch i32 %2, label %3 [
i32 113, label %5
i32 27, label %5
]
3: ; preds = %1
%4 = tail call i32 @usleep(i32 50000)
br label %1
5: ; preds = %1, %1
ret void
}
void fd229(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  a : {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  p026A:
    goto p026A;
    goto a;
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd229>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd229+0x7>

x86 assembly (clang, -O2):
<fd229>:
jmp    1100 <fd229>

LLVM IR (-O0):
define void @fd229(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = zext i32 %27 to i64
br label %29
29: ; preds = %29, %26
br label %29
30: ; preds = %30
br label %30
31: ; No predecessors!
%32 = load i32, i32* %2
%33 = zext i32 %32 to i64
br label %34
34: ; preds = %34, %31
br label %34
35: ; preds = %35
br label %35
36: ; No predecessors!
%37 = load i32, i32* %2
%38 = zext i32 %37 to i64
br label %39
39: ; preds = %39, %36
br label %39
40: ; preds = %40
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd229(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int float_compare(const void *av, const void *bv) {
  const float *a = (const float *)av;
  const float *b = (const float *)bv;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return +1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<float_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1141 <float_compare+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <float_compare+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1162 <float_compare+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <float_compare+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_compare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @float_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = fcmp ogt float %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void g_param_spec_boolean() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_boolean() {
ret void
}
signed short t5(signed short x) { return x--; }


x86 assembly (clang, -O0):
<t5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x2(%rbp)
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @t5(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = add i16 %3, -1
store i16 %4, i16* %2
ret i16 %3
}

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int32_t FileExists(char *fileName) {
  FILE *fp = NULL;
  if (0 == (fp = fopen(fileName, "r"))) {
    return 0;
  }
  fclose(fp);
  return 1;
}


x86 assembly (clang, -O0):
<FileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1162 <FileExists+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1172 <FileExists+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <FileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @FileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int fd_copy(int, int);
int fd_move(int to, int from) {
  if (to == from)
    return 0;
  if (fd_copy(to, from) == -1)
    return -1;
  close(from);
  return 0;
}


x86 assembly (clang, -O0):
<fd_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <fd_move+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1175 <fd_move+0x55>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <fd_copy@plt>
cmp    $0xffffffff,%eax
jne    1166 <fd_move+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <fd_move+0x55>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_move>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cmp    %esi,%edi
je     1143 <fd_move+0x23>
mov    %esi,%ebp
call   1040 <fd_copy@plt>
cmp    $0xffffffff,%eax
je     113e <fd_move+0x1e>
mov    %ebp,%edi
call   1030 <close@plt>
jmp    1143 <fd_move+0x23>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fd_move(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @fd_copy(i32 %11, i32 %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %3
br label %19
16: ; preds = %10
%17 = load i32, i32* %5
%18 = call i32 @close(i32 %17)
store i32 0, i32* %3
br label %19
19: ; preds = %16, %15, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @fd_move(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 @fd_copy(i32 %0, i32 %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @close(i32 %1)
br label %9
9: ; preds = %4, %2, %7
%10 = phi i32 [ 0, %7 ], [ 0, %2 ], [ -1, %4 ]
ret i32 %10
}
void mdp4_dtv_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe) { return; }


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

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

LLVM IR (-O0):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dtv_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca i32
%4 = alloca %struct.mdp4_overlay_pipe*
store i32 %0, i32* %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dtv_pipe_queue(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
int test_036(int a, int b, int c, int d) { return ((d >> 31) & 1) + a + a; }


x86 assembly (clang, -O0):
<test_036>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_036>:
mov    %edi,%eax
shld   $0x1,%ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_036(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* %8
%10 = ashr i32 %9, 31
%11 = and i32 %10, 1
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test_036(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %3, i32 1)
ret i32 %5
}
/* Type definitions */
struct record_t {
  int dummy;
};

/* Variables and functions */
int record_cmp(struct record_t *, struct record_t *);
int qcompar(const void *a, const void *b) {
  return record_cmp(*(struct record_t **)a, *(struct record_t **)b);
}


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

x86 assembly (clang, -O2):
<qcompar>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <record_cmp@plt>

LLVM IR (-O0):
%struct.record_t = type { i32 }
define i32 @qcompar(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 = bitcast i8* %5 to %struct.record_t**
%7 = load %struct.record_t*, %struct.record_t** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.record_t**
%10 = load %struct.record_t*, %struct.record_t** %9
%11 = call i32 @record_cmp(%struct.record_t* %7, %struct.record_t* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.record_t = type { i32 }
define i32 @qcompar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.record_t**
%4 = load %struct.record_t*, %struct.record_t** %3
%5 = bitcast i8* %1 to %struct.record_t**
%6 = load %struct.record_t*, %struct.record_t** %5
%7 = tail call i32 @record_cmp(%struct.record_t* %4, %struct.record_t* %6)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char buffer[1024];
  FILE *f;
  f = fopen("/etc/passwd", "r");
  fgets(buffer, 1024, f);
  fclose(f);
  printf("Line 1 = %s", buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    -0x418(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x410(%rbp),%rsi
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
lea    0xeaf(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe8c(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/etc/passwd\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"Line 1 = %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = load i32*, i32** %3
%7 = call i32 @fgets(i8* %5, i32 1024, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/etc/passwd\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"Line 1 = %s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fgets(i8* %2, i32 1024, i32* %3)
%5 = call i32 @fclose(i32* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setfont(int);
int /*<<< orphan*/ skip();
caseft() {
  skip();
  setfont(1);
}


x86 assembly (clang, -O0):
<caseft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <skip@plt>
mov    $0x1,%edi
call   1040 <setfont@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caseft>:
push   %rax
xor    %eax,%eax
call   1030 <skip@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <setfont@plt>

LLVM IR (-O0):
define i32 @caseft() {
%1 = alloca i32
%2 = call i32 (...) @skip()
%3 = call i32 @setfont(i32 1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @caseft() {
%1 = tail call i32 (...) @skip()
%2 = tail call i32 @setfont(i32 1)
ret i32 undef
}
/* Variables and functions */
double **matriz(int, int);
double **matriz_quadrada(int dim) { return matriz(dim, dim); }


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

x86 assembly (clang, -O2):
<matriz_quadrada>:
mov    %edi,%esi
jmp    1030 <matriz@plt>

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

LLVM IR (-O2):
define double** @matriz_quadrada(i32 %0) {
%2 = tail call double** @matriz(i32 %0, i32 %0)
ret double** %2
}
/* Variables and functions */
int /*<<< orphan*/ writeVerbose(int, char *, char *, char *, char *, char *);
void showUsage() {
  writeVerbose(1, "%s (%s) %s :: %s\n", "rexec.mod", "2.0",
               "pMonkey <pmonkey@foofus.net>",
               "Brute force module for REXEC sessions");
}


x86 assembly (clang, -O0):
<showUsage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xeeb(%rip),%rdx
lea    0xeee(%rip),%rcx
lea    0xeeb(%rip),%r8
lea    0xf01(%rip),%r9
call   1030 <writeVerbose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUsage>:
lea    0xee9(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xef7(%rip),%rcx
lea    0xef4(%rip),%r8
lea    0xf0a(%rip),%r9
mov    $0x1,%edi
jmp    1030 <writeVerbose@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s (%s) %s :: %s\0A\00"
@.str.1 = [10 x i8] c"rexec.mod\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [29 x i8] c"pMonkey <pmonkey@foofus.net>\00"
@.str.4 = [38 x i8] c"Brute force module for REXEC sessions\00"
define void @showUsage() {
%1 = call i32 @writeVerbose(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s (%s) %s :: %s\0A\00"
@.str.1 = [10 x i8] c"rexec.mod\00"
@.str.2 = [4 x i8] c"2.0\00"
@.str.3 = [29 x i8] c"pMonkey <pmonkey@foofus.net>\00"
@.str.4 = [38 x i8] c"Brute force module for REXEC sessions\00"
define void @showUsage() {
%1 = tail call i32 @writeVerbose(i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
ret void
}